(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 7.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[    113461,       3172]
NotebookOptionsPosition[    111196,       3096]
NotebookOutlinePosition[    112388,       3139]
CellTagsIndexPosition[    112345,       3136]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell["Changed for Mathematica 7     07 - 27 - 2010", "Text",
 CellChangeTimes->{{3.4892616449648027`*^9, 3.4892616872876763`*^9}, {
  3.4892635901517944`*^9, 3.4892635921953983`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"DateSequence", "[", 
    RowBox[{"date_", ",", "WantTime_"}], "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{"WantTime", "\[Equal]", "\"\<yes\>\""}], ",", 
     RowBox[{"Row", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{
        "date", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", 
        "\"\<-\>\"", ",", 
        RowBox[{
        "date", "\[LeftDoubleBracket]", "3", "\[RightDoubleBracket]"}], ",", 
        "\"\<-\>\"", ",", 
        RowBox[{
        "date", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", 
        "\"\< \>\"", ",", 
        RowBox[{
        "date", "\[LeftDoubleBracket]", "4", "\[RightDoubleBracket]"}], ",", 
        "\"\<:\>\"", ",", 
        RowBox[{
        "date", "\[LeftDoubleBracket]", "5", "\[RightDoubleBracket]"}]}], 
       "}"}], "]"}], ",", 
     RowBox[{"Row", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{
        "date", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", 
        "\"\<-\>\"", ",", 
        RowBox[{
        "date", "\[LeftDoubleBracket]", "3", "\[RightDoubleBracket]"}], ",", 
        "\"\<-\>\"", ",", 
        RowBox[{
        "date", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], 
       "}"}], "]"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{"DateSequence", "[", 
  RowBox[{
   RowBox[{"DateList", "[", "]"}], ",", "\"\<no\>\""}], "]"}]}], "Input"],

Cell[BoxData[
 TemplateBox[{"1","\"-\"","31","\"-\"","2014"},
  "RowDefault"]], "Output",
 CellChangeTimes->CompressedData["
1:eJxTTMoPSmVkYGDQAmJL09MPbf6/dPwgp8xiC6TZ7qZoJgHpNyaHut9zvnL8
c+vwz+38rxx5Ih6/bRB+5TjlWFDeVpFXju19TiW/gbQMw0UbHtFXjoeeXJrX
B6T3yWzM+wmkBVxbZ4RKvXK8V91xvh5I1zC8mzBH9pXjsuJWngdyrxyDmBZv
vi3/ynFVQ+yuMqVXjt8MJgfPVHvluGRJh8RejVeOO5yf+fRpvXIMWynbuUHn
leOZJ48r+fVeOf77yXup2/CV44mt4gcPOAPt17I8a+/+ylFnm4qHmccrxyNl
bZu4PV85Ct2aPO9I0CvHkDSuH2XBrxxVCu9u7oh95fhk7iL76LRXjpNk7euf
lL1yvLLt2Gf+5leOC5bcUeNpAap37JzmNhdozkfp2esXvnKskFi5+QuQDs44
eJtpxyvHhezOf/NOAO2blPXnM5COWB8UdPXSK8eZ2lprbgJpAODKryg=
  "]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"sind", "[", "t_", "]"}], ":=", 
   RowBox[{"Sin", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"cosd", "[", "t_", "]"}], ":=", 
   RowBox[{"Cos", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"tand", "[", "t_", "]"}], ":=", 
   RowBox[{"Tan", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"cotd", "[", "t_", "]"}], ":=", 
   RowBox[{"Cot", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"secd", "[", "t_", "]"}], ":=", 
   RowBox[{"Sec", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"cscd", "[", "t_", "]"}], ":=", 
   RowBox[{"Csc", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"arccosd", "[", "t_", "]"}], ":=", 
   RowBox[{
    RowBox[{"ArcCos", "[", "t", "]"}], "/", "Degree"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"arcsind", "[", "t_", "]"}], ":=", 
   RowBox[{
    RowBox[{"ArcSin", "[", "t", "]"}], "/", "Degree"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"arctand", "[", "t_", "]"}], ":=", 
   RowBox[{
    RowBox[{"ArcTan", "[", "t", "]"}], "/", "Degree"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"length", "[", "v_", "]"}], ":=", 
   RowBox[{"\[Sqrt]", 
    RowBox[{"(", 
     RowBox[{"v", ".", "v"}], ")"}]}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"unit", "[", "v_", "]"}], ":=", 
    RowBox[{"v", "/", 
     RowBox[{"length", "[", "v", "]"}]}]}], ";"}], "                "}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"Unit", "[", "v_", "]"}], ":=", 
    RowBox[{"v", "/", 
     RowBox[{"length", "[", "v", "]"}]}]}], ";"}], 
  "  "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"angle", "[", 
    RowBox[{"u_", ",", "v_"}], "]"}], "       ", ":=", 
   RowBox[{"N", "[", 
    RowBox[{"arccosd", "[", 
     RowBox[{
      RowBox[{"u", ".", "v"}], "/", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"length", "[", "u", "]"}], " ", 
        RowBox[{"length", "[", "v", "]"}]}], ")"}]}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"angle", "[", 
    RowBox[{"Apt_", ",", "Bpt_", ",", "Cpt_"}], "]"}], ":=", 
   RowBox[{"angle", "[", 
    RowBox[{
     RowBox[{"Apt", "-", "Bpt"}], ",", 
     RowBox[{"Cpt", "-", "Bpt"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"signedangle", "[", 
    RowBox[{"a_", ",", "b_", ",", "nor_"}], "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{"EqualNumbers", "[", 
      RowBox[{
       RowBox[{"angle", "[", 
        RowBox[{"a", ",", "b"}], "]"}], ",", "180."}], "]"}], ",", "180.", 
     ",", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Det", "[", 
         RowBox[{"{", 
          RowBox[{"a", ",", "b", ",", "nor"}], "}"}], "]"}], ">=", "0"}], ",", 
       RowBox[{"angle", "[", 
        RowBox[{"a", ",", "b"}], "]"}], ",", 
       RowBox[{"-", 
        RowBox[{"angle", "[", 
         RowBox[{"a", ",", "b"}], "]"}]}]}], "]"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"SignedAngle", "[", 
    RowBox[{"a_", ",", "b_", ",", "nor_"}], "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{"EqualNumbers", "[", 
      RowBox[{
       RowBox[{"Angle", "[", 
        RowBox[{"a", ",", "b"}], "]"}], ",", "\[Pi]"}], "]"}], ",", "\[Pi]", 
     ",", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Det", "[", 
         RowBox[{"{", 
          RowBox[{"a", ",", "b", ",", "nor"}], "}"}], "]"}], ">=", "0"}], ",", 
       RowBox[{"Angle", "[", 
        RowBox[{"a", ",", "b"}], "]"}], ",", 
       RowBox[{"-", 
        RowBox[{"Angle", "[", 
         RowBox[{"a", ",", "b"}], "]"}]}]}], "]"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"SignedAngle", "[", 
     RowBox[{"a_", ",", "b_", ",", "nor_"}], "]"}], ":=", 
    RowBox[{"If", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"Det", "[", 
        RowBox[{"{", 
         RowBox[{"a", ",", "b", ",", "nor"}], "}"}], "]"}], ">=", "0"}], ",", 
      RowBox[{"Angle", "[", 
       RowBox[{"a", ",", "b"}], "]"}], ",", 
      RowBox[{"-", 
       RowBox[{"Angle", "[", 
        RowBox[{"a", ",", "b"}], "]"}]}]}], "]"}]}], ";"}], " ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{"Decide", " ", "what", " ", "you", " ", "want", " ", "here"}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}], 
  "   "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"Angle", "[", 
     RowBox[{"u_", ",", "v_"}], "]"}], ":=", 
    RowBox[{"Chop", "[", 
     RowBox[{
      RowBox[{"ArcCos", "[", 
       RowBox[{
        RowBox[{"u", ".", "v"}], "/", 
        RowBox[{"(", 
         RowBox[{
          RowBox[{"length", "[", "u", "]"}], " ", 
          RowBox[{"length", "[", "v", "]"}]}], ")"}]}], "]"}], ",", 
      RowBox[{"10", "^", 
       RowBox[{"(", 
        RowBox[{"-", "5"}], ")"}]}]}], "]"}]}], ";"}], 
  "                     ", "\n", "                       ", 
  RowBox[{"(*", 
   RowBox[{
   "Chop", " ", "for", " ", "case", " ", "where", " ", "u", " ", "and", " ", 
    "v", " ", "are", " ", 
    RowBox[{"parallel", ".", " ", "May"}], " ", "be", " ", "dangerous", " ", 
    "though"}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"Angle", "[", 
     RowBox[{"u_", ",", "v_"}], "]"}], ":=", 
    RowBox[{"ArcCos", "[", 
     FractionBox[
      RowBox[{"u", ".", "v"}], 
      RowBox[{
       RowBox[{"length", "[", "u", "]"}], " ", 
       RowBox[{"length", "[", "v", "]"}]}]], "]"}]}], ";"}], "    ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{"Choose", " ", 
     RowBox[{"one", ".", " ", "This"}], " ", "used", " ", "to", " ", "be", 
     " ", "AngleRad"}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}], "   "}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ScalarProj", "[", 
    RowBox[{"a_", ",", "b_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{"a", ".", "b"}], "/", 
    RowBox[{"length", "[", "b", "]"}]}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"VectorProj", "[", 
    RowBox[{"a_", ",", "b_"}], "]"}], ":=", 
   RowBox[{
    FractionBox[
     RowBox[{"a", ".", "b"}], 
     RowBox[{"b", ".", "b"}]], "b"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"PlaneProj", "[", 
    RowBox[{"a_", ",", "normal_"}], "]"}], ":=", 
   RowBox[{"a", "-", 
    RowBox[{"VectorProj", "[", 
     RowBox[{"a", ",", "normal"}], "]"}]}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"RightAngle", "[", 
    RowBox[{"a_", ",", "b_", ",", "c_", ",", "scale_"}], "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"b", "+", 
      RowBox[{"scale", "*", 
       RowBox[{"unit", "[", 
        RowBox[{"a", "-", "b"}], "]"}]}]}], ",", 
     RowBox[{"b", "+", 
      RowBox[{"scale", "*", 
       RowBox[{"unit", "[", 
        RowBox[{"a", "-", "b"}], "]"}]}], "+", 
      RowBox[{"scale", "*", 
       RowBox[{"unit", "[", 
        RowBox[{"c", "-", "b"}], "]"}]}]}], ",", 
     RowBox[{"b", "+", 
      RowBox[{"scale", "*", 
       RowBox[{"unit", "[", 
        RowBox[{"c", "-", "b"}], "]"}]}]}]}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"XRot", "[", "t_", "]"}], ":=", 
   RowBox[{"(", GridBox[{
      {"1", "0", "0"},
      {"0", 
       RowBox[{"Cos", "[", "t", "]"}], 
       RowBox[{"-", 
        RowBox[{"Sin", "[", "t", "]"}]}]},
      {"0", 
       RowBox[{"Sin", "[", "t", "]"}], 
       RowBox[{"  ", 
        RowBox[{"Cos", "[", "t", "]"}]}]}
     }], ")"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"YRot", "[", "t_", "]"}], ":=", 
   RowBox[{"(", GridBox[{
      {
       RowBox[{"   ", 
        RowBox[{"Cos", "[", "t", "]"}]}], "0", 
       RowBox[{"Sin", "[", "t", "]"}]},
      {"0", "1", "0"},
      {
       RowBox[{"-", 
        RowBox[{"Sin", "[", "t", "]"}]}], "0", 
       RowBox[{"Cos", "[", "t", "]"}]}
     }], ")"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ZRot", "[", "t_", "]"}], ":=", 
   RowBox[{"(", GridBox[{
      {
       RowBox[{"Cos", "[", "t", "]"}], 
       RowBox[{"-", 
        RowBox[{"Sin", "[", "t", "]"}]}], "0"},
      {
       RowBox[{"Sin", "[", "t", "]"}], 
       RowBox[{"  ", 
        RowBox[{"Cos", "[", "t", "]"}]}], "0"},
      {"0", "0", "1"}
     }], ")"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"xrot", "[", "t_", "]"}], ":=", 
   RowBox[{"XRot", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"yrot", "[", "t_", "]"}], ":=", 
   RowBox[{"YRot", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"zrot", "[", "t_", "]"}], ":=", 
   RowBox[{"ZRot", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"rot111", "=", 
   RowBox[{"(", GridBox[{
      {"0", "0", "1"},
      {"1", "0", "0"},
      {"0", "1", "0"}
     }], ")"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"RotMatrix2", "[", 
     RowBox[{"{", 
      RowBox[{"w_", ",", 
       RowBox[{"{", 
        RowBox[{"x_", ",", "y_", ",", "z_"}], "}"}]}], "}"}], "]"}], ":=", 
    RowBox[{"(", "\[NoBreak]", GridBox[{
       {
        RowBox[{
         SuperscriptBox["w", "2"], "+", 
         SuperscriptBox["x", "2"], "-", 
         SuperscriptBox["y", "2"], "-", 
         SuperscriptBox["z", "2"]}], 
        RowBox[{"2", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{
            RowBox[{"-", "w"}], " ", "z"}], "+", 
           RowBox[{"x", " ", "y"}]}], ")"}]}], 
        RowBox[{"2", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"w", " ", "y"}], "+", 
           RowBox[{"x", " ", "z"}]}], ")"}]}]},
       {
        RowBox[{"2", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"w", " ", "z"}], "+", 
           RowBox[{"x", " ", "y"}]}], ")"}]}], 
        RowBox[{
         SuperscriptBox["w", "2"], "-", 
         SuperscriptBox["x", "2"], "+", 
         SuperscriptBox["y", "2"], "-", 
         SuperscriptBox["z", "2"]}], 
        RowBox[{"2", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{
            RowBox[{"-", "w"}], " ", "x"}], "+", 
           RowBox[{"y", " ", "z"}]}], ")"}]}]},
       {
        RowBox[{"2", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{
            RowBox[{"-", "w"}], " ", "y"}], "+", 
           RowBox[{"x", " ", "z"}]}], ")"}]}], 
        RowBox[{"2", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"w", " ", "x"}], "+", 
           RowBox[{"y", " ", "z"}]}], ")"}]}], 
        RowBox[{
         SuperscriptBox["w", "2"], "-", 
         SuperscriptBox["x", "2"], "-", 
         SuperscriptBox["y", "2"], "+", 
         SuperscriptBox["z", "2"]}]}
      }], "\[NoBreak]", ")"}]}], " ", ";"}], "              ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{"quaternion", " ", 
     RowBox[{"{", 
      RowBox[{"w", ",", 
       RowBox[{"{", 
        RowBox[{"x", ",", "y", ",", "z"}], "}"}]}], "}"}], " ", "must", " ", 
     "have", " ", "length", " ", "one"}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"rot", "[", 
   RowBox[{"\[Xi]_", ",", "v_"}], "]"}], ":=", 
  RowBox[{"RotMatrix2", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"cosd", "[", 
      RowBox[{"\[Xi]", "/", "2"}], "]"}], ",", 
     RowBox[{
      RowBox[{"sind", "[", 
       RowBox[{"\[Xi]", "/", "2"}], "]"}], 
      RowBox[{"unit", "[", "v", "]"}]}]}], "}"}], 
   "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"ROT", "[", 
     RowBox[{"\[Xi]_", ",", "v_"}], "]"}], ":=", 
    RowBox[{"RotMatrix2", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"Cos", "[", 
        RowBox[{"\[Xi]", "/", "2"}], "]"}], ",", 
       RowBox[{
        RowBox[{"Sin", "[", 
         RowBox[{"\[Xi]", "/", "2"}], "]"}], 
        FractionBox["v", 
         SqrtBox[
          RowBox[{"v", ".", "v"}]]]}]}], "}"}], "]"}]}], ";"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"rot", "[", 
       RowBox[{"\[Xi]_", ",", "v_"}], "]"}], ":=", 
      RowBox[{
       RowBox[{"Transpose", "[", 
        RowBox[{"vertical", "[", "v", "]"}], "]"}], ".", 
       RowBox[{"zrot", "[", "\[Xi]", "]"}], ".", 
       RowBox[{"vertical", "[", "v", "]"}]}]}], ";", "  ", "old"}], ",", " ", 
    RowBox[{
    "but", " ", "the", " ", "two", " ", "rots", " ", "are", " ", 
     "equivalent"}]}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"xref", "=", 
   RowBox[{"DiagonalMatrix", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"-", "1"}], ",", "1", ",", "1"}], "}"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"yref", "=", 
   RowBox[{"DiagonalMatrix", "[", 
    RowBox[{"{", 
     RowBox[{"1", ",", 
      RowBox[{"-", "1"}], ",", "1"}], "}"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"zref", "=", 
   RowBox[{"DiagonalMatrix", "[", 
    RowBox[{"{", 
     RowBox[{"1", ",", "1", ",", 
      RowBox[{"-", "1"}]}], "}"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"RefWithUnitNormal", "[", 
     RowBox[{"{", 
      RowBox[{"u_", ",", "v_", ",", "w_"}], "}"}], "]"}], ":=", 
    RowBox[{"(", GridBox[{
       {
        RowBox[{"1", "-", 
         RowBox[{"2", 
          SuperscriptBox["u", "2"]}]}], 
        RowBox[{
         RowBox[{"-", "2"}], "u", " ", "v"}], 
        RowBox[{
         RowBox[{"-", "2"}], "u", " ", "w"}]},
       {
        RowBox[{
         RowBox[{"-", "2"}], "u", " ", "v"}], 
        RowBox[{"1", "-", 
         RowBox[{"2", 
          SuperscriptBox["v", "2"]}]}], 
        RowBox[{
         RowBox[{"-", "2"}], "v", " ", "w"}]},
       {
        RowBox[{
         RowBox[{"-", "2"}], "u", " ", "w"}], 
        RowBox[{
         RowBox[{"-", "2"}], "v", " ", "w"}], 
        RowBox[{"1", "-", 
         RowBox[{"2", 
          SuperscriptBox["w", "2"]}]}]}
      }], ")"}]}], ";"}], "     ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{
     RowBox[{"changed", " ", "'"}], 
     RowBox[{"Reflection", "'"}], " ", 
     RowBox[{"to", " ", "'"}], 
     RowBox[{"Ref", "'"}], " ", "April", " ", "2012"}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"RefWithUnitNormal", "[", 
     RowBox[{"{", 
      RowBox[{"u_", ",", "v_"}], "}"}], "]"}], ":=", 
    RowBox[{"(", GridBox[{
       {
        RowBox[{"1", "-", 
         RowBox[{"2", 
          SuperscriptBox["u", "2"]}]}], 
        RowBox[{
         RowBox[{"-", "2"}], "u", " ", "v"}]},
       {
        RowBox[{
         RowBox[{"-", "2"}], "u", " ", "v"}], 
        RowBox[{"1", "-", 
         RowBox[{"2", 
          SuperscriptBox["v", "2"]}]}]}
      }], ")"}]}], ";"}], "              ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{
     RowBox[{"changed", " ", "'"}], 
     RowBox[{"Reflection", "'"}], " ", 
     RowBox[{"to", " ", "'"}], 
     RowBox[{"Ref", "'"}], " ", "April", " ", "2012"}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{"id", "=", 
   RowBox[{"IdentityMatrix", "[", "3", "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"Rot2D", "[", "t_", "]"}], ":=", 
   RowBox[{"(", GridBox[{
      {
       RowBox[{"Cos", "[", "t", "]"}], 
       RowBox[{"-", 
        RowBox[{"Sin", "[", "t", "]"}]}]},
      {
       RowBox[{"Sin", "[", "t", "]"}], 
       RowBox[{"  ", 
        RowBox[{"Cos", "[", "t", "]"}]}]}
     }], ")"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"rot2d", "[", "t_", "]"}], ":=", 
   RowBox[{"Rot2D", "[", 
    RowBox[{"t", " ", "Degree"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"sign", "[", "x_", "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{"x", "<", "0"}], ",", 
     RowBox[{"-", "1"}], ",", "1"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"xyztp", "[", 
    RowBox[{"{", 
     RowBox[{"\[Theta]_", ",", "\[Phi]_"}], "}"}], "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{
      RowBox[{"cosd", "[", "\[Theta]", "]"}], " ", 
      RowBox[{"sind", "[", "\[Phi]", "]"}]}], ",", 
     RowBox[{
      RowBox[{"sind", "[", "\[Theta]", "]"}], " ", 
      RowBox[{"sind", "[", "\[Phi]", "]"}]}], ",", 
     RowBox[{"cosd", "[", "\[Phi]", "]"}]}], "}"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"xyzTP", "[", 
    RowBox[{"{", 
     RowBox[{"t_", ",", "p_"}], "}"}], "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{
      RowBox[{"Cos", "[", "t", "]"}], " ", 
      RowBox[{"Sin", "[", "p", "]"}]}], ",", 
     RowBox[{
      RowBox[{"Sin", "[", "t", "]"}], " ", 
      RowBox[{"Sin", "[", "p", "]"}]}], ",", 
     RowBox[{"Cos", "[", "p", "]"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"phi", "[", 
    RowBox[{"{", 
     RowBox[{"x_", ",", "y_", ",", "z_"}], "}"}], "]"}], ":=", 
   RowBox[{"arccosd", "[", 
    FractionBox["z", 
     SqrtBox[
      RowBox[{
       SuperscriptBox["x", "2"], "+", 
       SuperscriptBox["y", "2"], "+", 
       SuperscriptBox["z", "2"]}]]], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"Phi", "[", 
    RowBox[{"{", 
     RowBox[{"x_", ",", "y_", ",", "z_"}], "}"}], "]"}], ":=", 
   RowBox[{"ArcCos", "[", 
    FractionBox["z", 
     SqrtBox[
      RowBox[{
       SuperscriptBox["x", "2"], "+", 
       SuperscriptBox["y", "2"], "+", 
       SuperscriptBox["z", "2"]}]]], "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"theta", "[", 
     RowBox[{"{", 
      RowBox[{"x_", ",", "y_", ",", "z_"}], "}"}], "]"}], ":=", 
    RowBox[{"If", "[", 
     RowBox[{
      RowBox[{
       SqrtBox[
        RowBox[{
         SuperscriptBox["x", "2"], "+", 
         SuperscriptBox["y", "2"]}]], "==", "0"}], ",", "0", ",", 
      "               ", "\n", 
      RowBox[{"If", "[", 
       RowBox[{
        RowBox[{"x", "\[GreaterEqual]", "0"}], ",", 
        RowBox[{"arcsind", "[", 
         FractionBox["y", 
          SqrtBox[
           RowBox[{
            SuperscriptBox["x", "2"], "+", 
            SuperscriptBox["y", "2"]}]]], "]"}], ",", "\n", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{"y", ">=", "0"}], ",", 
          RowBox[{"180", "-", 
           RowBox[{"arcsind", "[", 
            FractionBox["y", 
             SqrtBox[
              RowBox[{
               SuperscriptBox["x", "2"], "+", 
               SuperscriptBox["y", "2"]}]]], "]"}]}], ",", "\n", 
          "\t\t\t\t           ", 
          RowBox[{
           RowBox[{"-", "180"}], "-", 
           RowBox[{"arcsind", "[", 
            FractionBox["y", 
             SqrtBox[
              RowBox[{
               SuperscriptBox["x", "2"], "+", 
               SuperscriptBox["y", "2"]}]]], "]"}]}]}], "]"}]}], "]"}]}], 
     "]"}]}], ";"}], "   ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{
    "changed", " ", "Feb", " ", "2009", " ", "also", " ", "eliminated", " ", 
     "carets"}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"Theta", "[", 
     RowBox[{"{", 
      RowBox[{"x_", ",", "y_", ",", "z_"}], "}"}], "]"}], ":=", 
    RowBox[{"If", "[", 
     RowBox[{
      RowBox[{
       SqrtBox[
        RowBox[{
         SuperscriptBox["x", "2"], "+", 
         SuperscriptBox["y", "2"]}]], "==", "0"}], ",", "0", ",", 
      "               ", "\n", 
      RowBox[{"If", "[", 
       RowBox[{
        RowBox[{"y", "\[GreaterEqual]", "0"}], ",", 
        RowBox[{"ArcCos", "[", 
         FractionBox["x", 
          SqrtBox[
           RowBox[{
            SuperscriptBox["x", "2"], "+", 
            SuperscriptBox["y", "2"]}]]], "]"}], ",", 
        RowBox[{"-", 
         RowBox[{"ArcCos", "[", 
          FractionBox["x", 
           SqrtBox[
            RowBox[{
             SuperscriptBox["x", "2"], "+", 
             SuperscriptBox["y", "2"]}]]], "]"}]}]}], "]"}]}], "]"}]}], ";"}],
   "  ", 
  RowBox[{"(*", 
   StyleBox[" ",
    FontColor->RGBColor[1, 0, 0]], 
   StyleBox[
    RowBox[{
     RowBox[{
      RowBox[{"\[Theta]", " ", 
       StyleBox[
        RowBox[{"i", 
         StyleBox["n",
          FontColor->RGBColor[1, 0, 0]]}]], 
       StyleBox[" ",
        FontColor->RGBColor[1, 0, 0]], 
       StyleBox["rad",
        FontColor->RGBColor[1, 0, 0]]}], "ians"}], ",", " ", 
     RowBox[{
      RowBox[{"from", " ", "-", 
       RowBox[{"\[Pi]", " ", "to", " ", "\[Pi]"}]}], ";", " ", 
      RowBox[{"used", " ", "for", " ", "lune", " ", "coordinates"}]}]}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"theta2d", "[", "v_", "]"}], ":=", 
   RowBox[{"theta", "[", 
    RowBox[{"Append", "[", 
     RowBox[{"v", ",", "0"}], "]"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"phitheta", "[", "v_", "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"phi", "[", "v", "]"}], ",", 
     RowBox[{"theta", "[", "v", "]"}]}], "}"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"vertical", "[", "p_", "]"}], ":=", 
    RowBox[{
     RowBox[{"zrot", "[", 
      RowBox[{"theta", "[", "p", "]"}], "]"}], ".", 
     RowBox[{"yrot", "[", 
      RowBox[{"-", 
       RowBox[{"phi", "[", "p", "]"}]}], "]"}], ".", 
     RowBox[{"zrot", "[", 
      RowBox[{"-", 
       RowBox[{"theta", "[", "p", "]"}]}], "]"}]}]}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{"Changed", " ", "Aug", " ", "2002"}], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"vertical", "[", 
     RowBox[{"a_", ",", "b_"}], "]"}], ":=", 
    RowBox[{
     RowBox[{"zrot", "[", 
      RowBox[{"-", 
       RowBox[{"theta", "[", 
        RowBox[{
         RowBox[{"vertical", "[", "a", "]"}], ".", "b"}], "]"}]}], "]"}], ".", 
     RowBox[{"vertical", "[", "a", "]"}]}]}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{
   "makes", " ", "a", " ", "vertical", " ", "and", " ", "gives", " ", "b", 
    " ", "a", " ", "theta", " ", "coordinate", " ", "of", " ", "zero"}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"verticalViaXAxis", "[", "p_", "]"}], ":=", 
    RowBox[{
     RowBox[{"yrot", "[", 
      RowBox[{"-", 
       RowBox[{"phi", "[", "p", "]"}]}], "]"}], ".", 
     RowBox[{"zrot", "[", 
      RowBox[{"-", 
       RowBox[{"theta", "[", "p", "]"}]}], "]"}]}]}], ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{"Changed", " ", "Aug", " ", "2002"}], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"range", "[", 
    RowBox[{"domain_", ",", "f_"}], "]"}], ":=", 
   RowBox[{"Union", "[", 
    RowBox[{"f", "/@", "domain"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"ListComplement", "[", 
     RowBox[{"universe_", ",", "set_"}], "]"}], ":=", 
    RowBox[{"Select", "[", 
     RowBox[{"universe", ",", 
      RowBox[{
       RowBox[{"!", 
        RowBox[{"MemberQ", "[", 
         RowBox[{"set", ",", "#"}], "]"}]}], "&"}]}], "]"}]}], ";"}], "  ", 
  RowBox[{"(*", 
   RowBox[{
   "Mathematica", " ", "Complement", " ", "no", " ", "good", " ", "for", " ", 
    "lists"}], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"partition", "[", 
    RowBox[{"set_", ",", "r_"}], "]"}], ":=", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"part", "=", 
      RowBox[{"{", "}"}]}], ";", 
     RowBox[{"remaining", "=", "set"}], ";", "\n", "     ", 
     RowBox[{"While", "[", 
      RowBox[{
       RowBox[{"remaining", "!=", 
        RowBox[{"{", "}"}]}], ",", "\n", "\t   ", 
       RowBox[{
        RowBox[{"EqCl", "=", 
         RowBox[{"Select", "[", 
          RowBox[{"remaining", ",", 
           RowBox[{
            RowBox[{"r", "[", 
             RowBox[{
              RowBox[{"First", "[", "remaining", "]"}], ",", "#"}], "]"}], 
            " ", "&"}]}], "]"}]}], ";", "\n", "\t\t", 
        RowBox[{"part", "=", 
         RowBox[{"Join", "[", 
          RowBox[{"part", ",", 
           RowBox[{"{", "EqCl", "}"}]}], "]"}]}], ";", "\n", "\t\t", 
        RowBox[{"remaining", "=", 
         RowBox[{"ListComplement", "[", 
          RowBox[{"remaining", ",", "EqCl"}], "]"}]}]}]}], "]"}], ";", 
     "part"}], ")"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"QuotientTopology", "[", 
    RowBox[{"domain_", ",", "f_"}], "]"}], ":=", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"Rangef", "=", 
      RowBox[{"range", "[", 
       RowBox[{"domain", ",", "f"}], "]"}]}], ";", "\n", "\t\t", 
     RowBox[{"Clear", "[", "EqCl", "]"}], ";", "\n", "\t\t", 
     RowBox[{
      RowBox[{"EqCl", "[", "RangeValue_", "]"}], ":=", 
      RowBox[{"{", "}"}]}], ";", "\n", "\t\t", 
     RowBox[{"Do", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"EqCl", "[", 
         RowBox[{"f", "[", 
          RowBox[{"domain", "[", 
           RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], "=", 
        RowBox[{"Join", "[", 
         RowBox[{
          RowBox[{"EqCl", "[", 
           RowBox[{"f", "[", 
            RowBox[{"domain", "[", 
             RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], ",", 
          RowBox[{"{", 
           RowBox[{"domain", "[", 
            RowBox[{"[", "i", "]"}], "]"}], "}"}]}], "]"}]}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", 
         RowBox[{"Length", "[", "domain", "]"}]}], "}"}]}], "]"}], ";", "\n", 
     "     ", 
     RowBox[{"EqCl", "/@", "Rangef"}]}], ")"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"MyFlatten", "[", 
    RowBox[{"{", 
     RowBox[{"x_", ",", "y_"}], "}"}], "]"}], ":=", 
   RowBox[{"Join", "[", 
    RowBox[{
     RowBox[{"{", "x", "}"}], ",", "y"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"UnsortedUnion", "[", "list_", "]"}], ":=", 
   RowBox[{"Sort", "[", 
    RowBox[{
     RowBox[{"Union", "[", "list", "]"}], ",", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"Position", "[", 
         RowBox[{"list", ",", "#1"}], "]"}], "[", 
        RowBox[{"[", 
         RowBox[{"1", ",", "1"}], "]"}], "]"}], "<", 
       RowBox[{
        RowBox[{"Position", "[", 
         RowBox[{"list", ",", "#2"}], "]"}], "[", 
        RowBox[{"[", 
         RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "&"}]}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"CartesianProduct", "[", "ListOfSets_", "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"Length", "[", "ListOfSets", "]"}], "==", "2"}], ",", "\t\t", 
     RowBox[{"Union", "[", 
      RowBox[{"Flatten", "[", 
       RowBox[{
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{
            RowBox[{"ListOfSets", "[", 
             RowBox[{"[", 
              RowBox[{"1", ",", "i"}], "]"}], "]"}], ",", 
            RowBox[{"ListOfSets", "[", 
             RowBox[{"[", 
              RowBox[{"2", ",", "j"}], "]"}], "]"}]}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{"i", ",", 
            RowBox[{"Length", "[", 
             RowBox[{"ListOfSets", "[", 
              RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{"j", ",", 
            RowBox[{"Length", "[", 
             RowBox[{"ListOfSets", "[", 
              RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", 
        "1"}], "]"}], "]"}], ",", "\n", 
     RowBox[{"MyFlatten", "/@", 
      RowBox[{"CartesianProduct", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{
          RowBox[{"Take", "[", 
           RowBox[{"ListOfSets", ",", "1"}], "]"}], "[", 
          RowBox[{"[", "1", "]"}], "]"}], ",", "\n", "\t\t\t", 
         RowBox[{"CartesianProduct", "[", 
          RowBox[{"Drop", "[", 
           RowBox[{"ListOfSets", ",", "1"}], "]"}], "]"}]}], "}"}], "]"}]}]}],
     "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ForSomeMine", "[", 
    RowBox[{"domain_", ",", "predicate_"}], "]"}], ":=", 
   RowBox[{"MemberQ", "[", 
    RowBox[{
     RowBox[{"predicate", "/@", "domain"}], ",", "True"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ForAllMine", "[", 
    RowBox[{"domain_", ",", "predicate_"}], "]"}], ":=", 
   RowBox[{"!", 
    RowBox[{"MemberQ", "[", 
     RowBox[{
      RowBox[{"predicate", "/@", "domain"}], ",", "False"}], "]"}]}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ListIsComplex", "[", "v_", "]"}], ":=", 
   RowBox[{"MemberQ", "[", 
    RowBox[{
     RowBox[{"Head", "/@", "v"}], ",", "Complex"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"EqualNumbers", "[", 
    RowBox[{"x_", ",", "y_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{"Abs", "[", 
     RowBox[{"x", "-", "y"}], "]"}], "<", ".00001"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"EqualVectors", "[", 
    RowBox[{"x_", ",", "y_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{"length", "[", 
     RowBox[{"x", "-", "y"}], "]"}], "<", ".00001"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"SegmentList", "[", "PointList_", "]"}], ":=", 
   RowBox[{
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"PointList", "[", 
        RowBox[{"[", "#", "]"}], "]"}], ",", 
       RowBox[{"PointList", "[", 
        RowBox[{"[", 
         RowBox[{"#", "+", "1"}], "]"}], "]"}]}], "}"}], "&"}], "/@", 
    RowBox[{"Range", "[", 
     RowBox[{
      RowBox[{"Length", "[", "PointList", "]"}], "-", "1"}], "]"}]}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"EquatorList", "=", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"zrot", "[", "#", "]"}], ".", 
      RowBox[{"{", 
       RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], "&"}], "/@", 
    RowBox[{"Range", "[", 
     RowBox[{
      RowBox[{"-", "181"}], ",", "179", ",", "2"}], "]"}]}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"MapEyeward", "[", 
     RowBox[{"x_", ",", "distance_", ",", "eye_"}], "]"}], ":=", 
    RowBox[{"x", "+", 
     RowBox[{"distance", "*", 
      RowBox[{"unit", "[", "eye", "]"}]}]}]}], ";"}], "   ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{"usually", " ", "distance"}], " ", "=", " ", 
    RowBox[{".01", " ", "is", " ", "enough"}]}], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"MapListEyeward", "[", 
    RowBox[{"list_", ",", "distance_", ",", "eye_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{
     RowBox[{"MapEyeward", "[", 
      RowBox[{"#", ",", "distance", ",", "eye"}], "]"}], "&"}], "/@", 
    "list"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"MakeReal", "[", "z_", "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"Length", "[", "z", "]"}], "==", "0"}], ",", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"Abs", "[", 
         RowBox[{"Im", "[", "z", "]"}], "]"}], "<", ".00001"}], ",", 
       RowBox[{"Re", "[", "z", "]"}], ",", "z"}], "]"}], ",", 
     RowBox[{"MakeReal", "/@", "z"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"BasicPoly", "[", 
    RowBox[{"i_", ",", "j_", ",", "RangeX_", ",", "RangeY_"}], "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"RangeX", "[", 
        RowBox[{"[", "i", "      ", "]"}], "]"}], ",", 
       RowBox[{"RangeY", "[", 
        RowBox[{"[", "j", "]"}], "]"}]}], "}"}], ",", " ", "\n", 
     "\t\t                                                                    \
 ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"RangeX", "[", 
        RowBox[{"[", 
         RowBox[{"i", "+", "1"}], "]"}], "]"}], ",", 
       RowBox[{"RangeY", "[", 
        RowBox[{"[", "j", "]"}], "]"}]}], "}"}], ",", "\n", 
     "\t\t                                                                    \
 ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"RangeX", "[", 
        RowBox[{"[", 
         RowBox[{"i", "+", "1"}], "]"}], "]"}], ",", 
       RowBox[{"RangeY", "[", 
        RowBox[{"[", 
         RowBox[{"j", "+", "1"}], "]"}], "]"}]}], "}"}], ",", "\n", 
     "\t\t                                                                    \
 ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"RangeX", "[", 
        RowBox[{"[", "i", "       ", "]"}], "]"}], ",", 
       RowBox[{"RangeY", "[", 
        RowBox[{"[", 
         RowBox[{"j", "+", "1"}], "]"}], "]"}]}], "}"}]}], 
    RowBox[{"(*", 
     RowBox[{",", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"RangeX", "[", 
         RowBox[{"[", "i", "      ", "]"}], "]"}], ",", 
        RowBox[{"RangeY", "[", 
         RowBox[{"[", "j", "]"}], "]"}]}], "}"}]}], "*)"}], "}"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"BasicPolys", "[", 
    RowBox[{"RangeX_", ",", "RangeY_"}], "]"}], ":=", 
   RowBox[{"Flatten", "[", 
    RowBox[{
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"BasicPoly", "[", 
        RowBox[{"i", ",", "j", ",", "RangeX", ",", "RangeY"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", 
         RowBox[{
          RowBox[{"Length", "[", "RangeX", "]"}], "-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"j", ",", 
         RowBox[{
          RowBox[{"Length", "[", "RangeY", "]"}], "-", "1"}]}], "}"}]}], 
      "]"}], ",", "1"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"myRange", "[", 
    RowBox[{"x1_", ",", "x2_", ",", "Nsubintervals_"}], "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{"x2", "<=", "x1"}], ",", 
     RowBox[{"{", "}"}], ",", 
     RowBox[{"Range", "[", 
      RowBox[{"x1", ",", "x2", ",", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{"x2", "-", "x1"}], ")"}], "/", "Nsubintervals"}]}], "]"}]}], 
    "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"myRangeNoSign", "[", 
    RowBox[{"x1_", ",", "x2_", ",", "Nsubintervals_"}], "]"}], ":=", 
   RowBox[{"If", "[", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"Im", "[", "x1", "]"}], "!=", "0"}], "||", 
      RowBox[{
       RowBox[{"Im", "[", "x2", "]"}], "!=", "0"}]}], ",", 
     RowBox[{"myRange", "[", 
      RowBox[{"x1", ",", "x2", ",", "Nsubintervals"}], "]"}], ",", "\n", 
     "\t\t", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"x1", "<=", "x2"}], ",", 
       RowBox[{"myRange", "[", 
        RowBox[{"x1", ",", "x2", ",", "Nsubintervals"}], "]"}], ",", 
       RowBox[{"myRange", "[", 
        RowBox[{"x2", ",", "x1", ",", "Nsubintervals"}], "]"}]}], "]"}]}], 
    "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"BothSigns", "[", "list_", "]"}], ":=", 
   RowBox[{"Union", "[", 
    RowBox[{"Join", "[", 
     RowBox[{"list", ",", 
      RowBox[{"-", "list"}]}], "]"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"inject", "[", 
    RowBox[{"{", 
     RowBox[{"x_", ",", "y_"}], "}"}], "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{"x", ",", "y", ",", "0"}], "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"LineList", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"p1_", ",", "p2_"}], "}"}], ",", "nPts_"}], "]"}], ":=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{"1", "-", 
         RowBox[{"i", "/", "nPts"}]}], ")"}], "p1"}], "+", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{"i", "/", "nPts"}], ")"}], "p2"}]}], ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", "0", ",", "nPts"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"PrintEye", ":=", 
   RowBox[{"Print", "[", 
    RowBox[{"\"\<eye = \>\"", ",", 
     RowBox[{"Round", "[", 
      RowBox[{"eye", ",", ".01"}], "]"}], ",", 
     "\"\<;  (\[Theta], \[Phi]\!\(\*SubscriptBox[\()\), \(eye\)]\) = \>\"", 
     ",", 
     RowBox[{"Simplify", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"theta", "[", "eye", "]"}], ",", 
        RowBox[{"phi", "[", "eye", "]"}]}], "}"}], "]"}], ",", 
     "\"\<, \!\(\*SubscriptBox[\(\[Rho]\), \(eye\)]\) = \>\"", ",", 
     RowBox[{"length", "[", "eye", "]"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"CubeEdges", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", "1", ",", "1"}], "}"}]}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", "1", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", "1"}], "}"}]}], "}"}], ",", 
     "\[IndentingNewLine]", "  ", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", 
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}]}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", 
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}]}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", "1", ",", 
         RowBox[{"-", "1"}]}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", "1", ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", 
         RowBox[{"-", "1"}]}], "}"}]}], "}"}], ",", "\[IndentingNewLine]", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", "1"}], "}"}]}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", 
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", "1", ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", "1", ",", "1"}], "}"}]}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}]}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"xCubeFace", "=", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"xrot", "[", "#", "]"}], ".", 
      RowBox[{"{", 
       RowBox[{"1", ",", "1", ",", "1"}], "}"}]}], "&"}], "/@", 
    RowBox[{"Range", "[", 
     RowBox[{"90", ",", "360", ",", "90"}], "]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"CubeFacePolys", "=", 
   RowBox[{"Join", "[", 
    RowBox[{
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"MatrixPower", "[", 
           RowBox[{"rot111", ",", "i"}], "]"}], ".", "#"}], "&"}], "/@", 
        "xCubeFace"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", "0", ",", "3"}], "}"}]}], "]"}], ",", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"-", 
          RowBox[{
           RowBox[{"MatrixPower", "[", 
            RowBox[{"rot111", ",", "i"}], "]"}], ".", "#"}]}], "&"}], "/@", 
        "xCubeFace"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", "0", ",", "3"}], "}"}]}], "]"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RandomDirection", ":=", 
   RowBox[{"xyzTP", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"RandomReal", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "\[Pi]"}], ",", "\[Pi]"}], "}"}], "]"}], ",", 
      RowBox[{"ArcCos", "[", 
       RowBox[{"RandomReal", "[", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"-", "1"}], ",", "1"}], "}"}], "]"}], "]"}]}], "}"}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RandomRotation", ":=", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"tt", "=", 
      RowBox[{"RandomReal", "[", 
       RowBox[{"{", 
        RowBox[{"0", ",", 
         RowBox[{"2", "\[Pi]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{"pp", "=", 
      RowBox[{"ArcCos", "[", 
       RowBox[{"RandomReal", "[", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"-", "1"}], ",", "1"}], "}"}], "]"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"ss", "=", 
      RowBox[{"RandomReal", "[", 
       RowBox[{"{", 
        RowBox[{"0", ",", 
         RowBox[{"2", "\[Pi]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"RotMatrix2", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Cos", "[", 
          RowBox[{"ss", "/", "2"}], "]"}], ",", 
         RowBox[{
          RowBox[{"Sin", "[", 
           RowBox[{"ss", "/", "2"}], "]"}], 
          RowBox[{
           RowBox[{"ZRot", "[", "tt", "]"}], ".", 
           RowBox[{"YRot", "[", "pp", "]"}], ".", 
           RowBox[{"{", 
            RowBox[{"0", ",", "0", ",", "1"}], "}"}]}]}]}], "}"}], "]"}], ".", 
      RowBox[{"ZRot", "[", "tt", "]"}], ".", 
      RowBox[{"YRot", "[", "pp", "]"}]}]}], ")"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"uG", "=", 
    RowBox[{"{", 
     RowBox[{
      FractionBox[
       RowBox[{"{", 
        RowBox[{"1", ",", "0", ",", 
         RowBox[{"-", "1"}]}], "}"}], 
       SqrtBox["2"]], ",", 
      FractionBox[
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", "2", ",", 
         RowBox[{"-", "1"}]}], "}"}], 
       SqrtBox["6"]], ",", 
      FractionBox[
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", "1"}], "}"}], 
       SqrtBox["3"]]}], "}"}]}], ";"}], "  "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"arc", "[", 
    RowBox[{"a_", ",", "b_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"RotMatrix2", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Cos", "[", 
          RowBox[{"#", "/", "2"}], "]"}], ",", 
         RowBox[{
          RowBox[{"Sin", "[", 
           RowBox[{"#", "/", "2"}], "]"}], 
          RowBox[{"unit", "[", 
           RowBox[{"Cross", "[", 
            RowBox[{"a", ",", "b"}], "]"}], "]"}]}]}], "}"}], "]"}], ".", 
      "a"}], "&"}], "/@", 
    RowBox[{"myRange", "[", 
     RowBox[{"0", ",", 
      RowBox[{"Angle", "[", 
       RowBox[{"a", ",", "b"}], "]"}], ",", "30"}], "]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"InnerProductMatrix", "[", 
    RowBox[{"M_", ",", "N_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{"Flatten", "[", "M", "]"}], ".", 
    RowBox[{"Flatten", "[", "N", "]"}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"NormMatrix", "[", "M_", "]"}], ":=", 
   SqrtBox[
    RowBox[{"InnerProductMatrix", "[", 
     RowBox[{"M", ",", "M"}], "]"}]]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"UnitMatrix", "[", "M_", "]"}], ":=", 
   FractionBox["M", 
    RowBox[{"NormMatrix", "[", "M", "]"}]]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"AngleMatrix", "[", 
     RowBox[{"M_", ",", "N_"}], "]"}], ":=", 
    RowBox[{"ArcCos", "[", 
     FractionBox[
      RowBox[{"InnerProductMatrix", "[", 
       RowBox[{"M", ",", "N"}], "]"}], 
      RowBox[{
       RowBox[{"NormMatrix", "[", "M", "]"}], 
       RowBox[{"NormMatrix", "[", "N", "]"}]}]], "]"}]}], ";"}], "  ", 
  RowBox[{"(*", " ", 
   StyleBox["radians",
    FontColor->RGBColor[1, 0, 0]], 
   StyleBox[" ",
    FontColor->RGBColor[1, 0, 0]], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"SpherePolyList", "[", 
     RowBox[{
     "\[Rho]_", ",", "\[Theta]1_", ",", "\[Theta]2_", ",", "\[Phi]1_", ",", 
      "\[Phi]2_", ",", "\[CapitalDelta]\[Theta]_", ",", 
      "\[CapitalDelta]\[Phi]_"}], "]"}], ":=", 
    RowBox[{"Map", "[", 
     RowBox[{"xyztp", ",", " ", 
      RowBox[{"BasicPolys", "[", 
       RowBox[{
        RowBox[{"Range", "[", 
         RowBox[{
         "\[Theta]1", ",", "\[Theta]2", ",", "\[CapitalDelta]\[Theta]"}], 
         "]"}], ",", 
        RowBox[{"Range", "[", 
         RowBox[{"\[Phi]1", ",", "\[Phi]2", ",", "\[CapitalDelta]\[Phi]"}], 
         "]"}]}], "]"}], ",", 
      RowBox[{"{", "2", "}"}]}], "]"}]}], ";"}], 
  "   "}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"BarText", "[", 
    RowBox[{"{", 
     RowBox[{"x_", ",", "y_", ",", "z_"}], "}"}], "]"}], ":=", 
   RowBox[{"SequenceForm", "[", 
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"x", "\[GreaterEqual]", "0"}], ",", "x", ",", 
       OverscriptBox[
        RowBox[{"-", "x"}], "_"]}], "]"}], ",", "\"\< \>\"", ",", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"y", "\[GreaterEqual]", "0"}], ",", "y", ",", 
       OverscriptBox[
        RowBox[{"-", "y"}], "_"]}], "]"}], ",", "\"\< \>\"", ",", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"z", "\[GreaterEqual]", "0"}], ",", "z", ",", 
       OverscriptBox[
        RowBox[{"-", "z"}], "_"]}], "]"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"deg", "[", "AinRadians_", "]"}], ":=", 
   RowBox[{
    RowBox[{"SuperscriptBox", "[", 
     RowBox[{
      RowBox[{"Round", "[", 
       RowBox[{
        RowBox[{"AinRadians", "/", "Degree"}], ",", ".01"}], "]"}], ",", 
      "o"}], "]"}], "//", "DisplayForm"}]}], ";"}]}], "Input",
 PageBreakWithin->Automatic,
 PageBreakBelow->Automatic,
 CellChangeTimes->{
  3.4892780789458637`*^9, 3.4892781537179947`*^9, 3.489278185963251*^9, {
   3.4950345922209835`*^9, 3.4950346018774004`*^9}, {3.5011818616296425`*^9, 
   3.5011818626904445`*^9}, {3.520005149614954*^9, 3.520005186743019*^9}, {
   3.5228787025265994`*^9, 3.522878716086618*^9}, {3.523572395586929*^9, 
   3.5235725065031223`*^9}, {3.5235726199309196`*^9, 
   3.5235726788522224`*^9}, {3.523573043268858*^9, 3.523573114982183*^9}, {
   3.523913723635171*^9, 3.5239137509196186`*^9}, {3.523913805878515*^9, 
   3.523913806065715*^9}, {3.52415771607572*^9, 3.5241577374165573`*^9}, {
   3.5245987606895313`*^9, 3.5245988112024193`*^9}, {3.5246041379147077`*^9, 
   3.524604143889518*^9}, {3.5275223122177277`*^9, 3.5275223131381297`*^9}, {
   3.5278961648661757`*^9, 3.5278961685761805`*^9}, {3.531153615164811*^9, 
   3.531153615984812*^9}, {3.5330552480452175`*^9, 3.533055281051276*^9}, {
   3.5359904583292646`*^9, 3.535990479217701*^9}, {3.536343561909086*^9, 
   3.5363435629386873`*^9}, {3.543292666839031*^9, 3.543292719379923*^9}, {
   3.5469924224625473`*^9, 3.5469924490318937`*^9}, {3.5519977604570932`*^9, 
   3.5519977614398947`*^9}, {3.557771274368308*^9, 3.5577712872851305`*^9}, {
   3.557771609737693*^9, 3.557771612483298*^9}, {3.55837231696457*^9, 
   3.558372325981386*^9}, {3.5583752865857487`*^9, 3.5583753000329723`*^9}, {
   3.558903374762436*^9, 3.5589033779604416`*^9}, {3.559264638214102*^9, 
   3.5592646392281036`*^9}, {3.56152558249544*^9, 3.5615255833378415`*^9}, {
   3.567712960903683*^9, 3.567712961808485*^9}, 3.57212065450091*^9, {
   3.5745725034873385`*^9, 3.5745725429211073`*^9}, {3.5745726368819714`*^9, 
   3.574572649926094*^9}, {3.5914556336639824`*^9, 3.5914556350939846`*^9}, {
   3.592708592645027*^9, 3.592708593975029*^9}, {3.5928584937596893`*^9, 
   3.592858725568514*^9}, {3.5940571577699823`*^9, 3.594057159789985*^9}, {
   3.5944926563063498`*^9, 3.5944926865583925`*^9}, {3.594492775988516*^9, 
   3.594492776368517*^9}, {3.594492837360602*^9, 3.594492837900603*^9}, {
   3.594492902030691*^9, 3.594492936992742*^9}, {3.594493034604878*^9, 
   3.594493069734926*^9}, {3.594493106114977*^9, 3.59449322455514*^9}, 
   3.59449358324364*^9, 3.594515431065692*^9, {3.5945158044122105`*^9, 
   3.594515805652213*^9}, {3.5947545896350193`*^9, 3.5947546197350607`*^9}, {
   3.594828417439077*^9, 3.594828449759122*^9}, {3.594926309197468*^9, 
   3.5949263218474855`*^9}, {3.594927514981152*^9, 3.5949275153411527`*^9}, {
   3.594929784751333*^9, 3.5949297858113346`*^9}, {3.59492992226153*^9, 
   3.594929926493537*^9}, {3.5949299683435946`*^9, 3.5949300347036858`*^9}, 
   3.5950188480312347`*^9, {3.595034990484455*^9, 3.5950349917844567`*^9}, {
   3.5956466336034193`*^9, 3.5956467549255886`*^9}, {3.5956470300339727`*^9, 
   3.5956470819260454`*^9}, {3.5956471788681808`*^9, 3.595647201638212*^9}, {
   3.595647312358365*^9, 3.5956473913904753`*^9}, {3.595715611870015*^9, 
   3.5957156407100554`*^9}, {3.5957156923101263`*^9, 3.595715708840149*^9}, 
   3.595716187234812*^9, {3.5957170337435017`*^9, 3.595717044763517*^9}, {
   3.597258178496549*^9, 3.5972581787265496`*^9}},
 AspectRatioFixed->True],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"CoordsWrtFrame", "[", 
     RowBox[{"\[CapitalLambda]_", ",", "frame_"}], "]"}], ":=", 
    RowBox[{
     RowBox[{"Inverse", "[", "frame", "]"}], ".", "\[CapitalLambda]"}]}], 
   ";"}], "      ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{
     RowBox[{
     "The", " ", "frame", " ", "vectors", " ", "are", " ", "the", " ", 
      "COLUMNS", " ", "of", " ", "the", " ", "matrix", " ", "\"\<frame.\>\"", 
      " ", "I", " ", "changed", " ", "this", " ", "Nov", " ", "26"}], ",", 
     " ", "2013."}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Clear", "[", 
   RowBox[{
   "a", ",", "b", ",", "c", ",", "\[Lambda]1", ",", "\[Lambda]2", ",", 
    "\[Lambda]3"}], "]"}], ";", 
  RowBox[{"\[CapitalLambda]", "=", 
   RowBox[{"{", 
    RowBox[{"\[Lambda]1", ",", "\[Lambda]2", ",", "\[Lambda]3"}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"Solve", "[", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"a", 
      RowBox[{"{", 
       RowBox[{"1", ",", "0", ",", 
        RowBox[{"-", "1"}]}], "}"}]}], "+", 
     RowBox[{"b", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"1", "/", "2"}], ",", 
        RowBox[{"1", "/", "2"}], ",", 
        RowBox[{"-", "1"}]}], "}"}]}], "+", 
     RowBox[{"c", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"-", "1"}], ",", 
        RowBox[{"-", "1"}], ",", 
        RowBox[{"-", "1"}]}], "}"}]}]}], "\[Equal]", 
    RowBox[{"{", 
     RowBox[{"\[Lambda]1", ",", "\[Lambda]2", ",", "\[Lambda]3"}], "}"}]}], 
   ",", 
   RowBox[{"{", 
    RowBox[{"a", ",", "b", ",", "c"}], "}"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Frame1", "=", 
    RowBox[{"Transpose", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "0", ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"1", "/", "2"}], ",", 
         RowBox[{"1", "/", "2"}], ",", 
         RowBox[{"-", "1"}]}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}], ",", 
         RowBox[{"-", "1"}]}], "}"}]}], "}"}], "]"}]}], ";"}], "   ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{
     RowBox[{"Transpose", " ", "added", " ", "Nov", " ", "26"}], ",", " ", 
     "2013."}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{"CoordsWrtFrame", "[", 
  RowBox[{"\[CapitalLambda]", ",", "Frame1"}], "]"}]}], "Input",
 CellChangeTimes->{{3.5938130191244907`*^9, 3.59381310452661*^9}, {
  3.593813263512833*^9, 3.5938132661028366`*^9}, {3.5938234660811977`*^9, 
  3.5938234707032056`*^9}, {3.5945191585479183`*^9, 3.5945191911104636`*^9}, {
  3.594519344284678*^9, 3.5945193458346806`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"a", "\[Rule]", 
     RowBox[{"\[Lambda]1", "-", "\[Lambda]2"}]}], ",", 
    RowBox[{"b", "\[Rule]", 
     RowBox[{
      RowBox[{"-", 
       FractionBox[
        RowBox[{"2", " ", "\[Lambda]1"}], "3"]}], "+", 
      FractionBox[
       RowBox[{"4", " ", "\[Lambda]2"}], "3"], "-", 
      FractionBox[
       RowBox[{"2", " ", "\[Lambda]3"}], "3"]}]}], ",", 
    RowBox[{"c", "\[Rule]", 
     RowBox[{
      RowBox[{"-", 
       FractionBox["\[Lambda]1", "3"]}], "-", 
      FractionBox["\[Lambda]2", "3"], "-", 
      FractionBox["\[Lambda]3", "3"]}]}]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{3.5945193554846935`*^9, 3.5947458342146816`*^9, 
  3.5950182114603434`*^9, 3.6001982909109383`*^9, 3.600207201488344*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"\[Lambda]1", "-", "\[Lambda]2"}], ",", 
   RowBox[{
    RowBox[{"-", 
     FractionBox[
      RowBox[{"2", " ", "\[Lambda]1"}], "3"]}], "+", 
    FractionBox[
     RowBox[{"4", " ", "\[Lambda]2"}], "3"], "-", 
    FractionBox[
     RowBox[{"2", " ", "\[Lambda]3"}], "3"]}], ",", 
   RowBox[{
    RowBox[{"-", 
     FractionBox["\[Lambda]1", "3"]}], "-", 
    FractionBox["\[Lambda]2", "3"], "-", 
    FractionBox["\[Lambda]3", "3"]}]}], "}"}]], "Output",
 CellChangeTimes->{3.5945193554846935`*^9, 3.5947458342146816`*^9, 
  3.5950182114603434`*^9, 3.6001982909109383`*^9, 3.600207201547021*^9}]
}, Open  ]],

Cell["ARROW2D IS FOR 2-DIMENSIONAL.  REDONE JUNE 2002", "SmallText",
 Evaluatable->False,
 AspectRatioFixed->True,
 FontColor->RGBColor[1, 0, 0]],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"arrow", "[", 
    RowBox[{"tip_", ",", "scale_", ",", "theta_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"tip", "+", "#"}], " ", "&"}], ")"}], "/@", 
    RowBox[{"(", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"rot2d", "[", "theta", "]"}], ".", "#"}], " ", "&"}], "/@", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"0", ",", "0"}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{
           RowBox[{"-", "2"}], " ", "scale"}], ",", "scale"}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{
           RowBox[{"-", "1.2"}], "scale"}], ",", "0"}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{
           RowBox[{"-", "2"}], " ", "scale"}], ",", 
          RowBox[{"-", "scale"}]}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"0", ",", "0"}], "}"}]}], "}"}]}], ")"}]}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"arrow2D", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"x1_", ",", "y1_"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"x2_", ",", "y2_"}], "}"}], ",", "scale_"}], "]"}], ":=", 
   RowBox[{"arrow", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"x2", ",", "y2"}], "}"}], ",", "scale", ",", 
     RowBox[{"theta", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"x2", "-", "x1"}], ",", 
        RowBox[{"y2", "-", "y1"}], ",", "0"}], "}"}], "]"}]}], "]"}]}], 
  ";"}]}], "Input",
 PageBreakBelow->Automatic,
 AspectRatioFixed->True],

Cell[TextData[{
 "NEED ",
 StyleBox["ARROW3D",
  FontSlant->"Italic"],
 " FOR RAY PATH DIAGRAMS, AMONG OTHER THINGS. REVISED AUGUST 2002."
}], "SmallText",
 Evaluatable->False,
 AspectRatioFixed->True,
 FontColor->RGBColor[1, 0, 0]],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"CirclePoint", "[", 
     RowBox[{"i_", ",", "j_"}], "]"}], ":=", 
    RowBox[{"N", "[", 
     RowBox[{"j", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"-", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0", ",", "3"}], "}"}]}], "+", 
        RowBox[{
         RowBox[{"zrot", "[", "i", "]"}], ".", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0", ",", "0"}], "}"}]}]}], ")"}]}], "]"}]}], 
   ";"}], " ", 
  RowBox[{"(*", " ", 
   RowBox[{
    RowBox[{
     RowBox[{"watch", " ", "out"}], ";", " ", 
     RowBox[{
     "there", " ", "is", " ", "another", " ", "CirclePoint", " ", "in", " ", 
      "the", " ", "streetlight_parhelia", " ", "file"}]}], ",", " ", 
    RowBox[{"for", " ", "Minnaert", " ", "cigar"}]}], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ConePoly", "[", "i_", "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"CirclePoint", "[", 
      RowBox[{"i", ",", "1"}], "]"}], ",", 
     RowBox[{"CirclePoint", "[", 
      RowBox[{
       RowBox[{"i", "+", "30"}], ",", "1"}], "]"}], ",", 
     RowBox[{"{", 
      RowBox[{"0", ",", "0", ",", "0"}], "}"}]}], "}"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"CenterDisk", "[", 
    RowBox[{"v1_", ",", "v2_", ",", "scale_"}], "]"}], " ", ":=", 
   RowBox[{"v2", "+", 
    RowBox[{"scale", "*", 
     RowBox[{
      RowBox[{"Transpose", "[", 
       RowBox[{"vertical", "[", 
        RowBox[{"v2", "-", "v1"}], "]"}], "]"}], ".", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"CirclePoint", "[", 
          RowBox[{"0", ",", "1"}], "]"}], "+", 
         RowBox[{"CirclePoint", "[", 
          RowBox[{"180", ",", "1"}], "]"}]}], ")"}], "/", "2"}]}]}]}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ConeVertex", "[", 
    RowBox[{"v1_", ",", "v2_", ",", "scale_"}], "]"}], " ", ":=", 
   RowBox[{"v2", "+", 
    RowBox[{"scale", "*", 
     RowBox[{
      RowBox[{"Transpose", "[", 
       RowBox[{"vertical", "[", 
        RowBox[{"v2", "-", "v1"}], "]"}], "]"}], ".", 
      RowBox[{"CirclePoint", "[", 
       RowBox[{"0", ",", "0"}], "]"}]}]}]}]}], ";", 
  RowBox[{
   RowBox[{"DiskPoly", "[", 
    RowBox[{"v1_", ",", "v2_", ",", "scale_"}], "]"}], ":=", 
   RowBox[{"Map", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"v2", "+", 
       RowBox[{"scale", "*", 
        RowBox[{
         RowBox[{"Transpose", "[", 
          RowBox[{"vertical", "[", 
           RowBox[{"v2", "-", "v1"}], "]"}], "]"}], ".", "#"}]}]}], " ", 
      "&"}], ",", 
     RowBox[{
      RowBox[{
       RowBox[{"CirclePoint", "[", 
        RowBox[{"#", ",", "1"}], "]"}], "&"}], "/@", 
      RowBox[{"Range", "[", 
       RowBox[{"0", ",", "360", ",", "30"}], "]"}]}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ConePolyList", "[", 
    RowBox[{"v1_", ",", "v2_", ",", "scale_"}], "]"}], ":=", 
   RowBox[{"Map", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"v2", "+", 
       RowBox[{"scale", "*", 
        RowBox[{
         RowBox[{"Transpose", "[", 
          RowBox[{"vertical", "[", 
           RowBox[{"v2", "-", "v1"}], "]"}], "]"}], ".", "#"}]}]}], " ", 
      "&"}], ",", 
     RowBox[{"ConePoly", "/@", 
      RowBox[{"Range", "[", 
       RowBox[{"30", ",", "360", ",", "30"}], "]"}]}], ",", 
     RowBox[{"{", "2", "}"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"CircleList", "[", 
    RowBox[{"v1_", ",", "v2_", ",", "scale_", ",", "j_"}], "]"}], ":=", 
   RowBox[{"Map", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"v2", "+", 
       RowBox[{"scale", "*", 
        RowBox[{
         RowBox[{"Transpose", "[", 
          RowBox[{"vertical", "[", 
           RowBox[{"v2", "-", "v1"}], "]"}], "]"}], ".", 
         RowBox[{"CirclePoint", "[", 
          RowBox[{
           RowBox[{"#", "+", "30"}], ",", "j"}], "]"}]}]}]}], " ", "&"}], ",", 
     RowBox[{"Range", "[", 
      RowBox[{"0", ",", "360", ",", "30"}], "]"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"Arrow3D", "[", 
    RowBox[{"v1_", ",", "v2_", ",", "scale_", ",", "tkns_", ",", "eye_"}], 
    "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"EdgeForm", "[", "]"}], ",", 
       RowBox[{"GrayLevel", "[", "1", "]"}], ",", 
       RowBox[{"Polygon", "/@", 
        RowBox[{"ConePolyList", "[", 
         RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}]}]}], "}"}], ",", 
     RowBox[{"(*", " ", 
      StyleBox[
       RowBox[{"sign", " ", "added", " ", "April", " ", "2011"}],
       FontColor->RGBColor[1, 0, 0]], " ", "*)"}], "\n", 
     "\t\t                                                                    \
                                  ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"GrayLevel", "[", "1", "]"}], ",", 
       RowBox[{"Polygon", "[", 
        RowBox[{"DiskPoly", "[", 
         RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], "]"}]}], "}"}], ",", 
     "\n", "\t                                             ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"Thickness", "[", "tkns", "]"}], ",", 
       RowBox[{
        RowBox[{
         RowBox[{"Line", "[", 
          RowBox[{"CircleList", "[", 
           RowBox[{"v1", ",", "v2", ",", "scale", ",", "#"}], "]"}], "]"}], 
         "&"}], "/@", 
        RowBox[{"Range", "[", 
         RowBox[{"0", ",", "1", ",", 
          RowBox[{"1", "/", "7"}]}], "]"}]}], ",", "\n", "\t", 
       RowBox[{"If", "[", 
        RowBox[{"False", ",", 
         RowBox[{"Line", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"MapEyeward", "[", 
             RowBox[{"#", ",", ".01", ",", "eye"}], "]"}], "&"}], "/@", 
           "                     ", 
           RowBox[{"(*", " ", 
            RowBox[{
             RowBox[{
             "may", " ", "have", " ", "to", " ", "adjust", " ", "eyeward", 
              " ", "distance", " ", "here"}], ";", " ", 
             StyleBox[
              RowBox[{
              "I", " ", "took", " ", "this", " ", "out", " ", "March", " ", 
               "2011"}],
              FontColor->RGBColor[1, 0, 0]]}], " ", "*)"}], 
           RowBox[{"{", 
            RowBox[{
             RowBox[{
              RowBox[{"CenterDisk", "[", 
               RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], "+", 
              RowBox[{"scale", "*", 
               RowBox[{"unit", "[", 
                RowBox[{"Cross", "[", 
                 RowBox[{
                  RowBox[{"eye", "-", 
                   RowBox[{"CenterDisk", "[", 
                    RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}]}], ",", 
                  RowBox[{"v2", "-", "v1"}]}], "]"}], "]"}]}]}], ",", 
             RowBox[{"ConeVertex", "[", 
              RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], ",", "\n", 
             "\t\t\t      ", 
             RowBox[{
              RowBox[{"CenterDisk", "[", 
               RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], "-", 
              RowBox[{"scale", "*", 
               RowBox[{"unit", "[", 
                RowBox[{"Cross", "[", 
                 RowBox[{
                  RowBox[{"eye", "-", 
                   RowBox[{"CenterDisk", "[", 
                    RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}]}], ",", 
                  RowBox[{"v2", "-", "v1"}]}], "]"}], "]"}]}]}]}], "}"}]}], 
          "]"}], ",", 
         RowBox[{"{", "}"}]}], "]"}]}], "}"}]}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Arrow3D", "[", 
    RowBox[{
    "v1_", ",", "v2_", ",", "scale_", ",", "tkns_", ",", "eye_", ",", "1"}], 
    "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"EdgeForm", "[", "]"}], ",", 
       RowBox[{"GrayLevel", "[", "1", "]"}], ",", 
       RowBox[{"Polygon", "/@", 
        RowBox[{"ConePolyList", "[", 
         RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}]}]}], "}"}], ",", 
     RowBox[{"(*", " ", 
      StyleBox[
       RowBox[{"sign", " ", "added", " ", "April", " ", "2011"}],
       FontColor->RGBColor[1, 0, 0]], " ", "*)"}], "\n", 
     "\t\t                                                                    \
                                  ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"GrayLevel", "[", "1", "]"}], ",", 
       RowBox[{"Polygon", "[", 
        RowBox[{"DiskPoly", "[", 
         RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], "]"}]}], "}"}], ",", 
     "\n", "\t                                             ", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"Thickness", "[", "tkns", "]"}], ",", 
       RowBox[{
        RowBox[{
         RowBox[{"Line", "[", 
          RowBox[{"CircleList", "[", 
           RowBox[{"v1", ",", "v2", ",", "scale", ",", "#"}], "]"}], "]"}], 
         "&"}], "/@", 
        RowBox[{"Range", "[", 
         RowBox[{"0", ",", "1", ",", 
          RowBox[{"1", "/", "7"}]}], "]"}]}], ",", "\n", "\t", 
       RowBox[{"If", "[", 
        RowBox[{"False", ",", 
         RowBox[{"Line", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"MapEyeward", "[", 
             RowBox[{"#", ",", ".01", ",", "eye"}], "]"}], "&"}], "/@", 
           "                     ", 
           RowBox[{"(*", " ", 
            RowBox[{
             RowBox[{
             "may", " ", "have", " ", "to", " ", "adjust", " ", "eyeward", 
              " ", "distance", " ", "here"}], ";", " ", 
             StyleBox[
              RowBox[{
              "I", " ", "took", " ", "this", " ", "out", " ", "March", " ", 
               "2011"}],
              FontColor->RGBColor[1, 0, 0]]}], " ", "*)"}], 
           RowBox[{"{", 
            RowBox[{
             RowBox[{
              RowBox[{"CenterDisk", "[", 
               RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], "+", 
              RowBox[{"scale", "*", 
               RowBox[{"unit", "[", 
                RowBox[{"Cross", "[", 
                 RowBox[{
                  RowBox[{"eye", "-", 
                   RowBox[{"CenterDisk", "[", 
                    RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}]}], ",", 
                  RowBox[{"v2", "-", "v1"}]}], "]"}], "]"}]}]}], ",", 
             RowBox[{"ConeVertex", "[", 
              RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], ",", "\n", 
             "\t\t\t      ", 
             RowBox[{
              RowBox[{"CenterDisk", "[", 
               RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}], "-", 
              RowBox[{"scale", "*", 
               RowBox[{"unit", "[", 
                RowBox[{"Cross", "[", 
                 RowBox[{
                  RowBox[{"eye", "-", 
                   RowBox[{"CenterDisk", "[", 
                    RowBox[{"v1", ",", "v2", ",", "scale"}], "]"}]}], ",", 
                  RowBox[{"v2", "-", "v1"}]}], "]"}], "]"}]}]}]}], "}"}]}], 
          "]"}], ",", 
         RowBox[{"{", "}"}]}], "]"}]}], "}"}]}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"Arrow3D", "[", 
    RowBox[{"v1_", ",", "v2_", ",", "scale_", ",", "tkns_", ",", "eye_", ",", 
     RowBox[{"-", "1"}]}], "]"}], ":=", 
   RowBox[{"Arrow3D", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"2", "v2"}], "-", "v1"}], ",", 
     RowBox[{"v2", "+", 
      RowBox[{"3.2", "scale", "*", 
       RowBox[{"unit", "[", 
        RowBox[{"v1", "-", "v2"}], "]"}]}]}], ",", "scale", ",", "tkns", ",", 
     "eye", ",", "1"}], "]"}]}], ";"}]}], "Input",
 CellChangeTimes->{
  3.5005816242648864`*^9, {3.5097430914250536`*^9, 3.5097431414351225`*^9}, {
   3.5123906340047293`*^9, 3.512390671264781*^9}, {3.512390746624885*^9, 
   3.512390747434886*^9}, 3.5123908159849806`*^9, {3.5123908557050357`*^9, 
   3.5123908569650373`*^9}, {3.513262578763157*^9, 3.5132626713805184`*^9}, {
   3.5132627439206448`*^9, 3.5132627869611197`*^9}, {3.513263055063187*^9, 
   3.5132630931116533`*^9}, {3.5132633850193624`*^9, 3.5132633855809636`*^9}, 
   3.5132634755307207`*^9, {3.5132635813145046`*^9, 3.513263610190155*^9}}],

Cell[TextData[{
 "POINT P ON THE SPHERE IS VISIBLE FROM THE VIEWPOINT ",
 StyleBox["EYE",
  FontSlant->"Italic"],
 " IFF ",
 StyleBox["SEE[P,EYE]",
  FontSlant->"Italic"],
 ".\n",
 StyleBox["SEE",
  FontSlant->"Italic"],
 " IS NEEDED FOR LAST EXAMPLE IN NUMERAL FILE."
}], "SmallText",
 Evaluatable->False,
 AspectRatioFixed->True,
 FontColor->RGBColor[1, 0, 0]],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"SeeOnSphere", "[", 
    RowBox[{"p_", ",", "n_", ",", "eye_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{"ScalarProj", "[", 
     RowBox[{"p", ",", "eye"}], "]"}], ">", 
    FractionBox[
     SuperscriptBox["n", "2"], 
     RowBox[{"length", "[", "eye", "]"}]]}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"VisibleSegments", "[", 
    RowBox[{"SegmentList_", ",", "see_"}], "]"}], ":=", 
   RowBox[{"Select", "[", 
    RowBox[{"SegmentList", ",", 
     RowBox[{
      RowBox[{
       RowBox[{"see", "[", 
        RowBox[{"#", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], 
        "]"}], "&&", 
       RowBox[{"see", "[", 
        RowBox[{"#", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], 
        "]"}]}], "&"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"ThirdSegments", "[", "PointList_", "]"}], ":=", 
   RowBox[{
    RowBox[{"SegmentList", "[", "PointList", "]"}], "\[LeftDoubleBracket]", 
    RowBox[{"Select", "[", 
     RowBox[{
      RowBox[{"Range", "[", 
       RowBox[{
        RowBox[{"Length", "[", "PointList", "]"}], "-", "1"}], "]"}], ",", 
      RowBox[{
       RowBox[{
        RowBox[{"Mod", "[", 
         RowBox[{"#", ",", "3"}], "]"}], "\[Equal]", "1"}], "&"}]}], "]"}], 
    "\[RightDoubleBracket]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"VisibleCurve", "[", 
     RowBox[{
     "PointList_", ",", "n_", ",", "eye_", ",", "tkns_", ",", "hue_"}], "]"}],
     ":=", 
    RowBox[{"{", 
     RowBox[{"hue", ",", 
      RowBox[{"Thickness", "[", "tkns", "]"}], ",", 
      RowBox[{"Line", "/@", 
       RowBox[{"VisibleSegments", "[", 
        RowBox[{
         RowBox[{"SegmentList", "[", "PointList", "]"}], ",", 
         RowBox[{
          RowBox[{"SeeOnSphere", "[", 
           RowBox[{"#1", ",", "n", ",", "eye"}], "]"}], "&"}]}], "]"}]}]}], 
     "}"}]}], ";"}], "    ", 
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{
     RowBox[{"no", " ", "longer", " ", "Graphics3D"}], ",", " ", 
     RowBox[{"May", " ", "2012"}]}],
    FontColor->RGBColor[1, 0, 0]], " ", "*)"}]}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"WholeCurve", "[", 
    RowBox[{
    "PointList_", ",", "n_", ",", "eye_", ",", "ThicknessSolid_", ",", 
     "ThicknessDashed_", ",", "hue_"}], "]"}], ":=", "             ", 
   RowBox[{"(*", " ", 
    StyleBox[
     RowBox[{
      RowBox[{"no", " ", "longer", " ", "Graphics3D"}], ",", " ", 
      RowBox[{"May", " ", "2012"}]}],
     FontColor->RGBColor[1, 0, 0]], " ", "*)"}], 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"hue", ",", 
       RowBox[{"Thickness", "[", "ThicknessDashed", "]"}], ",", 
       RowBox[{"Line", "/@", 
        RowBox[{"ThirdSegments", "[", "PointList", "]"}]}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"hue", ",", 
       RowBox[{"Thickness", "[", "ThicknessSolid", "]"}], ",", 
       RowBox[{"Line", "/@", 
        RowBox[{"VisibleSegments", "[", 
         RowBox[{
          RowBox[{"SegmentList", "[", "PointList", "]"}], ",", 
          RowBox[{
           RowBox[{"SeeOnSphere", "[", 
            RowBox[{"#1", ",", "n", ",", "eye"}], "]"}], "&"}]}], "]"}]}]}], 
      "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"tpGraphics", "[", 
    RowBox[{
    "v_", ",", "eye_", ",", "ThicknessSolid_", ",", "ThicknessDashed_"}], 
    "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"WholeCurve", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{
          RowBox[{"zrot", "[", 
           RowBox[{"theta", "[", "v", "]"}], "]"}], ".", 
          RowBox[{"yrot", "[", 
           RowBox[{"-", "#"}], "]"}], ".", 
          RowBox[{"{", 
           RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], "&"}], "/@", 
        RowBox[{"Range", "[", 
         RowBox[{"0", ",", 
          RowBox[{"90", 
           RowBox[{"sign", "[", 
            RowBox[{"v", "[", 
             RowBox[{"[", "3", "]"}], "]"}], "]"}]}], ",", 
          RowBox[{"2", 
           RowBox[{"sign", "[", 
            RowBox[{"v", "[", 
             RowBox[{"[", "3", "]"}], "]"}], "]"}]}]}], "]"}]}], ",", "1", 
       ",", "eye", ",", "ThicknessSolid", ",", "ThicknessDashed"}], "]"}], 
     ",", "\[IndentingNewLine]", 
     RowBox[{"Graphics3D", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"Thickness", "[", 
         RowBox[{".9", "ThicknessSolid"}], "]"}], ",", 
        RowBox[{"Line", "[", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", 
           RowBox[{"xyztp", "[", 
            RowBox[{"{", 
             RowBox[{
              RowBox[{"theta", "[", "v", "]"}], ",", "90"}], "}"}], "]"}]}], 
          "}"}], "]"}]}], "}"}], "]"}]}], "}"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.508994997710577*^9, 3.508995003140585*^9}, {
   3.508995045550643*^9, 3.5089950596506624`*^9}, {3.5089952524409285`*^9, 
   3.508995259730939*^9}, {3.5118744273638315`*^9, 3.5118744292046347`*^9}, {
   3.5118747205039425`*^9, 3.511874734590767*^9}, {3.5118748654593954`*^9, 
   3.511874892166642*^9}, {3.511874992084816*^9, 3.5118750118344507`*^9}, 
   3.511875082190573*^9, 3.51187521798881*^9, {3.511878399458357*^9, 
   3.511878404684366*^9}, {3.546998714978611*^9, 3.5469987978266563`*^9}, {
   3.5469988311471148`*^9, 3.546998862156869*^9}, {3.546999511237503*^9, 
   3.546999533795142*^9}, {3.546999695380224*^9, 3.5469997008090334`*^9}, {
   3.546999780493973*^9, 3.5469998116784267`*^9}}]
}, Open  ]],

Cell["EXAMPLE:", "SmallText",
 CellChangeTimes->{{3.5947403421074266`*^9, 3.594740361376954*^9}},
 FontColor->RGBColor[1, 0, 0]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"eye", "=", 
   RowBox[{"10", 
    RowBox[{"{", 
     RowBox[{"3", ",", "2", ",", "1"}], "}"}]}]}], ";", 
  RowBox[{"Graphics3D", "[", 
   RowBox[{
    RowBox[{"WholeCurve", "[", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"zrot", "[", "#", "]"}], ".", 
         RowBox[{"{", 
          RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], "&"}], "/@", 
       RowBox[{"Range", "[", 
        RowBox[{"0", ",", "360", ",", "3"}], "]"}]}], ",", "1", ",", "eye", 
      ",", ".003", ",", ".002", ",", "Red"}], "]"}], ",", 
    RowBox[{"ViewPoint", "\[Rule]", "eye"}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.5469995769448175`*^9, 3.5469996772373924`*^9}, {
  3.546999727890681*^9, 3.5469997352070937`*^9}, {3.594740385729488*^9, 
  3.5947404707731094`*^9}}],

Cell[BoxData[
 Graphics3DBox[{
   {RGBColor[1, 0, 0], Thickness[0.002], 
    Line3DBox[
     NCache[{{1, 0, 0}, {Cos[3 Degree], Sin[3 Degree], 0}}, {{1, 0, 0}, {
       0.9986295347545738, 0.052335956242943835`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[9 Degree], Sin[9 Degree], 0}, {
       Cos[12 Degree], Sin[12 Degree], 0}}, {{
       0.9876883405951378, 0.15643446504023087`, 0}, {
       0.9781476007338057, 0.20791169081775934`, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (-1 + 5^Rational[1, 2]), 0}, {
       Cos[21 Degree], Sin[21 Degree], 0}}, {{
       0.9510565162951535, 0.30901699437494745`, 0}, {
       0.9335804264972017, 0.35836794954530027`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[27 Degree], Sin[27 Degree], 0}, {
       Rational[1, 2] 3^Rational[1, 2], Rational[1, 2], 0}}, {{
       0.8910065241883679, 0.45399049973954675`, 0}, {
       0.8660254037844386, 0.5, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (1 + 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {
       Cos[39 Degree], Sin[39 Degree], 0}}, {{
       0.8090169943749475, 0.5877852522924731, 0}, {
       0.7771459614569709, 0.6293203910498374, 0}}]], 
    Line3DBox[
     NCache[{{2^Rational[-1, 2], 2^Rational[-1, 2], 0}, {
       Sin[42 Degree], Cos[42 Degree], 0}}, {{
       0.7071067811865475, 0.7071067811865475, 0}, {
       0.6691306063588582, 0.7431448254773942, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[-1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (1 + 5^Rational[1, 2]), 0}, {
       Sin[33 Degree], Cos[33 Degree], 0}}, {{
       0.5877852522924731, 0.8090169943749475, 0}, {
       0.5446390350150271, 0.838670567945424, 0}}]], 
    Line3DBox[
     NCache[{{Sin[27 Degree], Cos[27 Degree], 0}, {
       Sin[24 Degree], Cos[24 Degree], 0}}, {{
       0.45399049973954675`, 0.8910065241883679, 0}, {
       0.4067366430758002, 0.9135454576426009, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (-1 + 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {
       Rational[1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 0}}, {{
       0.30901699437494745`, 0.9510565162951535, 0}, {
       0.2588190451025207, 0.9659258262890682, 0}}]], 
    Line3DBox[
     NCache[{{Sin[9 Degree], Cos[9 Degree], 0}, {
       Sin[6 Degree], Cos[6 Degree], 0}}, {{
       0.15643446504023087`, 0.9876883405951378, 0}, {
       0.10452846326765347`, 0.9945218953682733, 0}}]], 
    Line3DBox[
     NCache[{{0, 1, 0}, {-Sin[3 Degree], Cos[3 Degree], 0}}, {{0, 1, 
       0}, {-0.052335956242943835`, 0.9986295347545738, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[9 Degree], Cos[9 Degree], 0}, {-Sin[12 Degree], Cos[
        12 Degree], 0}}, {{-0.15643446504023087`, 0.9876883405951378, 
        0}, {-0.20791169081775934`, 0.9781476007338057, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (1 - 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {-
        Sin[21 Degree], Cos[21 Degree], 0}}, {{-0.30901699437494745`, 
        0.9510565162951535, 0}, {-0.35836794954530027`, 0.9335804264972017, 
        0}}]], Line3DBox[
     NCache[{{-Sin[27 Degree], Cos[27 Degree], 0}, {
       Rational[-1, 2], Rational[1, 2] 3^Rational[1, 2], 
        0}}, {{-0.45399049973954675`, 0.8910065241883679, 0}, {-0.5, 
        0.8660254037844386, 0}}]], 
    Line3DBox[
     NCache[{{-(Rational[5, 8] + Rational[-1, 8] 5^Rational[1, 2])^
         Rational[1, 2], Rational[1, 4] (1 + 5^Rational[1, 2]), 0}, {-
        Sin[39 Degree], Cos[39 Degree], 0}}, {{-0.5877852522924731, 
        0.8090169943749475, 0}, {-0.6293203910498374, 0.7771459614569709, 
        0}}]], Line3DBox[
     NCache[{{-2^Rational[-1, 2], 2^Rational[-1, 2], 0}, {-Cos[42 Degree], 
        Sin[42 Degree], 0}}, {{-0.7071067811865475, 0.7071067811865475, 
        0}, {-0.7431448254773942, 0.6691306063588582, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (-1 - 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {-
        Cos[33 Degree], Sin[33 Degree], 0}}, {{-0.8090169943749475, 
        0.5877852522924731, 0}, {-0.838670567945424, 0.5446390350150271, 
        0}}]], 
    Line3DBox[
     NCache[{{-Cos[27 Degree], Sin[27 Degree], 0}, {-Cos[24 Degree], Sin[
        24 Degree], 0}}, {{-0.8910065241883679, 0.45399049973954675`, 
        0}, {-0.9135454576426009, 0.4067366430758002, 0}}]], 
    Line3DBox[
     NCache[{{-(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
         Rational[1, 2], Rational[1, 4] (-1 + 5^Rational[1, 2]), 0}, {
       Rational[-1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        0}}, {{-0.9510565162951535, 0.30901699437494745`, 
        0}, {-0.9659258262890682, 0.2588190451025207, 0}}]], 
    Line3DBox[
     NCache[{{-Cos[9 Degree], Sin[9 Degree], 0}, {-Cos[6 Degree], Sin[
        6 Degree], 0}}, {{-0.9876883405951378, 0.15643446504023087`, 
        0}, {-0.9945218953682733, 0.10452846326765347`, 0}}]], 
    Line3DBox[
     NCache[{{-1, 0, 0}, {-Cos[3 Degree], -Sin[3 Degree], 0}}, {{-1, 0, 
       0}, {-0.9986295347545738, -0.052335956242943835`, 0}}]], 
    Line3DBox[
     NCache[{{-Cos[9 Degree], -Sin[9 Degree], 0}, {-Cos[12 Degree], -
        Sin[12 Degree], 0}}, {{-0.9876883405951378, -0.15643446504023087`, 
        0}, {-0.9781476007338057, -0.20791169081775934`, 0}}]], 
    Line3DBox[
     NCache[{{-(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
         Rational[1, 2], Rational[1, 4] (1 - 5^Rational[1, 2]), 0}, {-
        Cos[21 Degree], -Sin[21 Degree], 
        0}}, {{-0.9510565162951535, -0.30901699437494745`, 
        0}, {-0.9335804264972017, -0.35836794954530027`, 0}}]], 
    Line3DBox[
     NCache[{{-Cos[27 Degree], -Sin[27 Degree], 0}, {
       Rational[-1, 2] 3^Rational[1, 2], Rational[-1, 2], 
        0}}, {{-0.8910065241883679, -0.45399049973954675`, 
        0}, {-0.8660254037844386, -0.5, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (-1 - 5^
         Rational[1, 2]), -(Rational[5, 8] + 
          Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {-
        Cos[39 Degree], -Sin[39 Degree], 
        0}}, {{-0.8090169943749475, -0.5877852522924731, 
        0}, {-0.7771459614569709, -0.6293203910498374, 0}}]], 
    Line3DBox[
     NCache[{{-2^Rational[-1, 2], -2^Rational[-1, 2], 0}, {-Sin[42 Degree], -
        Cos[42 Degree], 0}}, {{-0.7071067811865475, -0.7071067811865475, 
        0}, {-0.6691306063588582, -0.7431448254773942, 0}}]], 
    Line3DBox[
     NCache[{{-(Rational[5, 8] + Rational[-1, 8] 5^Rational[1, 2])^
         Rational[1, 2], Rational[1, 4] (-1 - 5^Rational[1, 2]), 0}, {-
        Sin[33 Degree], -Cos[33 Degree], 
        0}}, {{-0.5877852522924731, -0.8090169943749475, 
        0}, {-0.5446390350150271, -0.838670567945424, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[27 Degree], -Cos[27 Degree], 0}, {-Sin[24 Degree], -
        Cos[24 Degree], 0}}, {{-0.45399049973954675`, -0.8910065241883679, 
        0}, {-0.4067366430758002, -0.9135454576426009, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (1 - 5^
         Rational[1, 2]), -(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
         Rational[1, 2], 0}, {
       Rational[-1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        Rational[-1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        0}}, {{-0.30901699437494745`, -0.9510565162951535, 
        0}, {-0.2588190451025207, -0.9659258262890682, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[9 Degree], -Cos[9 Degree], 0}, {-Sin[6 Degree], -
        Cos[6 Degree], 0}}, {{-0.15643446504023087`, -0.9876883405951378, 
        0}, {-0.10452846326765347`, -0.9945218953682733, 0}}]], 
    Line3DBox[
     NCache[{{0, -1, 0}, {Sin[3 Degree], -Cos[3 Degree], 0}}, {{0, -1, 0}, {
       0.052335956242943835`, -0.9986295347545738, 0}}]], 
    Line3DBox[
     NCache[{{Sin[9 Degree], -Cos[9 Degree], 0}, {
       Sin[12 Degree], -Cos[12 Degree], 0}}, {{
       0.15643446504023087`, -0.9876883405951378, 0}, {
       0.20791169081775934`, -0.9781476007338057, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (-1 + 
         5^Rational[1, 2]), -(Rational[5, 8] + 
          Rational[1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {
       Sin[21 Degree], -Cos[21 Degree], 0}}, {{
       0.30901699437494745`, -0.9510565162951535, 0}, {
       0.35836794954530027`, -0.9335804264972017, 0}}]], 
    Line3DBox[
     NCache[{{Sin[27 Degree], -Cos[27 Degree], 0}, {
       Rational[1, 2], Rational[-1, 2] 3^Rational[1, 2], 0}}, {{
       0.45399049973954675`, -0.8910065241883679, 0}, {
       0.5, -0.8660254037844386, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[-1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (-1 - 5^Rational[1, 2]), 0}, {
       Sin[39 Degree], -Cos[39 Degree], 0}}, {{
       0.5877852522924731, -0.8090169943749475, 0}, {
       0.6293203910498374, -0.7771459614569709, 0}}]], 
    Line3DBox[
     NCache[{{2^Rational[-1, 2], -2^Rational[-1, 2], 0}, {
       Cos[42 Degree], -Sin[42 Degree], 0}}, {{
       0.7071067811865475, -0.7071067811865475, 0}, {
       0.7431448254773942, -0.6691306063588582, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (1 + 
         5^Rational[1, 2]), -(Rational[5, 8] + 
          Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {
       Cos[33 Degree], -Sin[33 Degree], 0}}, {{
       0.8090169943749475, -0.5877852522924731, 0}, {
       0.838670567945424, -0.5446390350150271, 0}}]], 
    Line3DBox[
     NCache[{{Cos[27 Degree], -Sin[27 Degree], 0}, {
       Cos[24 Degree], -Sin[24 Degree], 0}}, {{
       0.8910065241883679, -0.45399049973954675`, 0}, {
       0.9135454576426009, -0.4067366430758002, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (1 - 5^Rational[1, 2]), 0}, {
       Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        Rational[-1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 0}}, {{
       0.9510565162951535, -0.30901699437494745`, 0}, {
       0.9659258262890682, -0.2588190451025207, 0}}]], 
    Line3DBox[
     NCache[{{Cos[9 Degree], -Sin[9 Degree], 0}, {
       Cos[6 Degree], -Sin[6 Degree], 0}}, {{
       0.9876883405951378, -0.15643446504023087`, 0}, {
       0.9945218953682733, -0.10452846326765347`, 0}}]]}, 
   {RGBColor[1, 0, 0], Thickness[0.003], 
    Line3DBox[
     NCache[{{1, 0, 0}, {Cos[3 Degree], Sin[3 Degree], 0}}, {{1, 0, 0}, {
       0.9986295347545738, 0.052335956242943835`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[3 Degree], Sin[3 Degree], 0}, {
       Cos[6 Degree], Sin[6 Degree], 0}}, {{
       0.9986295347545738, 0.052335956242943835`, 0}, {
       0.9945218953682733, 0.10452846326765347`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[6 Degree], Sin[6 Degree], 0}, {
       Cos[9 Degree], Sin[9 Degree], 0}}, {{
       0.9945218953682733, 0.10452846326765347`, 0}, {
       0.9876883405951378, 0.15643446504023087`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[9 Degree], Sin[9 Degree], 0}, {
       Cos[12 Degree], Sin[12 Degree], 0}}, {{
       0.9876883405951378, 0.15643446504023087`, 0}, {
       0.9781476007338057, 0.20791169081775934`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[12 Degree], Sin[12 Degree], 0}, {
       Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 0}}, {{
       0.9781476007338057, 0.20791169081775934`, 0}, {
       0.9659258262890682, 0.2588190451025207, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        0}, {(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (-1 + 5^Rational[1, 2]), 0}}, {{
       0.9659258262890682, 0.2588190451025207, 0}, {
       0.9510565162951535, 0.30901699437494745`, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (-1 + 5^Rational[1, 2]), 0}, {
       Cos[21 Degree], Sin[21 Degree], 0}}, {{
       0.9510565162951535, 0.30901699437494745`, 0}, {
       0.9335804264972017, 0.35836794954530027`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[21 Degree], Sin[21 Degree], 0}, {
       Cos[24 Degree], Sin[24 Degree], 0}}, {{
       0.9335804264972017, 0.35836794954530027`, 0}, {
       0.9135454576426009, 0.4067366430758002, 0}}]], 
    Line3DBox[
     NCache[{{Cos[24 Degree], Sin[24 Degree], 0}, {
       Cos[27 Degree], Sin[27 Degree], 0}}, {{
       0.9135454576426009, 0.4067366430758002, 0}, {
       0.8910065241883679, 0.45399049973954675`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[27 Degree], Sin[27 Degree], 0}, {
       Rational[1, 2] 3^Rational[1, 2], Rational[1, 2], 0}}, {{
       0.8910065241883679, 0.45399049973954675`, 0}, {
       0.8660254037844386, 0.5, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 2] 3^Rational[1, 2], Rational[1, 2], 0}, {
       Cos[33 Degree], Sin[33 Degree], 0}}, {{0.8660254037844386, 0.5, 0}, {
       0.838670567945424, 0.5446390350150271, 0}}]], 
    Line3DBox[
     NCache[{{Cos[33 Degree], Sin[33 Degree], 0}, {
       Rational[1, 4] (1 + 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}}, {{
       0.838670567945424, 0.5446390350150271, 0}, {
       0.8090169943749475, 0.5877852522924731, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (1 + 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {
       Cos[39 Degree], Sin[39 Degree], 0}}, {{
       0.8090169943749475, 0.5877852522924731, 0}, {
       0.7771459614569709, 0.6293203910498374, 0}}]], 
    Line3DBox[
     NCache[{{Cos[39 Degree], Sin[39 Degree], 0}, {
       Cos[42 Degree], Sin[42 Degree], 0}}, {{
       0.7771459614569709, 0.6293203910498374, 0}, {
       0.7431448254773942, 0.6691306063588582, 0}}]], 
    Line3DBox[
     NCache[{{Cos[42 Degree], Sin[42 Degree], 0}, {
       2^Rational[-1, 2], 2^Rational[-1, 2], 0}}, {{
       0.7431448254773942, 0.6691306063588582, 0}, {
       0.7071067811865475, 0.7071067811865475, 0}}]], 
    Line3DBox[
     NCache[{{2^Rational[-1, 2], 2^Rational[-1, 2], 0}, {
       Sin[42 Degree], Cos[42 Degree], 0}}, {{
       0.7071067811865475, 0.7071067811865475, 0}, {
       0.6691306063588582, 0.7431448254773942, 0}}]], 
    Line3DBox[
     NCache[{{Sin[42 Degree], Cos[42 Degree], 0}, {
       Sin[39 Degree], Cos[39 Degree], 0}}, {{
       0.6691306063588582, 0.7431448254773942, 0}, {
       0.6293203910498374, 0.7771459614569709, 0}}]], 
    Line3DBox[
     NCache[{{Sin[39 Degree], Cos[39 Degree], 
        0}, {(Rational[5, 8] + Rational[-1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (1 + 5^Rational[1, 2]), 0}}, {{
       0.6293203910498374, 0.7771459614569709, 0}, {
       0.5877852522924731, 0.8090169943749475, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[-1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (1 + 5^Rational[1, 2]), 0}, {
       Sin[33 Degree], Cos[33 Degree], 0}}, {{
       0.5877852522924731, 0.8090169943749475, 0}, {
       0.5446390350150271, 0.838670567945424, 0}}]], 
    Line3DBox[
     NCache[{{Sin[33 Degree], Cos[33 Degree], 0}, {
       Rational[1, 2], Rational[1, 2] 3^Rational[1, 2], 0}}, {{
       0.5446390350150271, 0.838670567945424, 0}, {
       0.5, 0.8660254037844386, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 2], Rational[1, 2] 3^Rational[1, 2], 0}, {
       Sin[27 Degree], Cos[27 Degree], 0}}, {{0.5, 0.8660254037844386, 0}, {
       0.45399049973954675`, 0.8910065241883679, 0}}]], 
    Line3DBox[
     NCache[{{Sin[27 Degree], Cos[27 Degree], 0}, {
       Sin[24 Degree], Cos[24 Degree], 0}}, {{
       0.45399049973954675`, 0.8910065241883679, 0}, {
       0.4067366430758002, 0.9135454576426009, 0}}]], 
    Line3DBox[
     NCache[{{Sin[24 Degree], Cos[24 Degree], 0}, {
       Sin[21 Degree], Cos[21 Degree], 0}}, {{
       0.4067366430758002, 0.9135454576426009, 0}, {
       0.35836794954530027`, 0.9335804264972017, 0}}]], 
    Line3DBox[
     NCache[{{Sin[21 Degree], Cos[21 Degree], 0}, {
       Rational[1, 4] (-1 + 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}}, {{
       0.35836794954530027`, 0.9335804264972017, 0}, {
       0.30901699437494745`, 0.9510565162951535, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (-1 + 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {
       Rational[1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 0}}, {{
       0.30901699437494745`, 0.9510565162951535, 0}, {
       0.2588190451025207, 0.9659258262890682, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 0}, {
       Sin[12 Degree], Cos[12 Degree], 0}}, {{
       0.2588190451025207, 0.9659258262890682, 0}, {
       0.20791169081775934`, 0.9781476007338057, 0}}]], 
    Line3DBox[
     NCache[{{Sin[12 Degree], Cos[12 Degree], 0}, {
       Sin[9 Degree], Cos[9 Degree], 0}}, {{
       0.20791169081775934`, 0.9781476007338057, 0}, {
       0.15643446504023087`, 0.9876883405951378, 0}}]], 
    Line3DBox[
     NCache[{{Sin[9 Degree], Cos[9 Degree], 0}, {
       Sin[6 Degree], Cos[6 Degree], 0}}, {{
       0.15643446504023087`, 0.9876883405951378, 0}, {
       0.10452846326765347`, 0.9945218953682733, 0}}]], 
    Line3DBox[
     NCache[{{Sin[6 Degree], Cos[6 Degree], 0}, {
       Sin[3 Degree], Cos[3 Degree], 0}}, {{
       0.10452846326765347`, 0.9945218953682733, 0}, {
       0.052335956242943835`, 0.9986295347545738, 0}}]], 
    Line3DBox[
     NCache[{{Sin[3 Degree], Cos[3 Degree], 0}, {0, 1, 0}}, {{
       0.052335956242943835`, 0.9986295347545738, 0}, {0, 1, 0}}]], 
    Line3DBox[
     NCache[{{0, 1, 0}, {-Sin[3 Degree], Cos[3 Degree], 0}}, {{0, 1, 
       0}, {-0.052335956242943835`, 0.9986295347545738, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[3 Degree], Cos[3 Degree], 0}, {-Sin[6 Degree], Cos[
        6 Degree], 0}}, {{-0.052335956242943835`, 0.9986295347545738, 
        0}, {-0.10452846326765347`, 0.9945218953682733, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[6 Degree], Cos[6 Degree], 0}, {-Sin[9 Degree], Cos[
        9 Degree], 0}}, {{-0.10452846326765347`, 0.9945218953682733, 
        0}, {-0.15643446504023087`, 0.9876883405951378, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[9 Degree], Cos[9 Degree], 0}, {-Sin[12 Degree], Cos[
        12 Degree], 0}}, {{-0.15643446504023087`, 0.9876883405951378, 
        0}, {-0.20791169081775934`, 0.9781476007338057, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[12 Degree], Cos[12 Degree], 0}, {
       Rational[-1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        0}}, {{-0.20791169081775934`, 0.9781476007338057, 
        0}, {-0.2588190451025207, 0.9659258262890682, 0}}]], 
    Line3DBox[
     NCache[{{Rational[-1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 
        Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 0}, {
       Rational[1, 4] (1 - 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[1, 8] 5^Rational[1, 2])^Rational[1, 2], 
        0}}, {{-0.2588190451025207, 0.9659258262890682, 
        0}, {-0.30901699437494745`, 0.9510565162951535, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (1 - 5^Rational[1, 2]), (Rational[5, 8] + 
         Rational[1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {-
        Sin[21 Degree], Cos[21 Degree], 0}}, {{-0.30901699437494745`, 
        0.9510565162951535, 0}, {-0.35836794954530027`, 0.9335804264972017, 
        0}}]], Line3DBox[
     NCache[{{-Sin[21 Degree], Cos[21 Degree], 0}, {-Sin[24 Degree], Cos[
        24 Degree], 0}}, {{-0.35836794954530027`, 0.9335804264972017, 
        0}, {-0.4067366430758002, 0.9135454576426009, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[24 Degree], Cos[24 Degree], 0}, {-Sin[27 Degree], Cos[
        27 Degree], 0}}, {{-0.4067366430758002, 0.9135454576426009, 
        0}, {-0.45399049973954675`, 0.8910065241883679, 0}}]], 
    Line3DBox[
     NCache[{{-Sin[27 Degree], Cos[27 Degree], 0}, {
       Rational[-1, 2], Rational[1, 2] 3^Rational[1, 2], 
        0}}, {{-0.45399049973954675`, 0.8910065241883679, 0}, {-0.5, 
        0.8660254037844386, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[-1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (-1 - 5^Rational[1, 2]), 0}, {
       Sin[39 Degree], -Cos[39 Degree], 0}}, {{
       0.5877852522924731, -0.8090169943749475, 0}, {
       0.6293203910498374, -0.7771459614569709, 0}}]], 
    Line3DBox[
     NCache[{{Sin[39 Degree], -Cos[39 Degree], 0}, {
       Sin[42 Degree], -Cos[42 Degree], 0}}, {{
       0.6293203910498374, -0.7771459614569709, 0}, {
       0.6691306063588582, -0.7431448254773942, 0}}]], 
    Line3DBox[
     NCache[{{Sin[42 Degree], -Cos[42 Degree], 0}, {
       2^Rational[-1, 2], -2^Rational[-1, 2], 0}}, {{
       0.6691306063588582, -0.7431448254773942, 0}, {
       0.7071067811865475, -0.7071067811865475, 0}}]], 
    Line3DBox[
     NCache[{{2^Rational[-1, 2], -2^Rational[-1, 2], 0}, {
       Cos[42 Degree], -Sin[42 Degree], 0}}, {{
       0.7071067811865475, -0.7071067811865475, 0}, {
       0.7431448254773942, -0.6691306063588582, 0}}]], 
    Line3DBox[
     NCache[{{Cos[42 Degree], -Sin[42 Degree], 0}, {
       Cos[39 Degree], -Sin[39 Degree], 0}}, {{
       0.7431448254773942, -0.6691306063588582, 0}, {
       0.7771459614569709, -0.6293203910498374, 0}}]], 
    Line3DBox[
     NCache[{{Cos[39 Degree], -Sin[39 Degree], 0}, {
       Rational[1, 4] (1 + 
         5^Rational[1, 2]), -(Rational[5, 8] + 
          Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}}, {{
       0.7771459614569709, -0.6293203910498374, 0}, {
       0.8090169943749475, -0.5877852522924731, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 4] (1 + 
         5^Rational[1, 2]), -(Rational[5, 8] + 
          Rational[-1, 8] 5^Rational[1, 2])^Rational[1, 2], 0}, {
       Cos[33 Degree], -Sin[33 Degree], 0}}, {{
       0.8090169943749475, -0.5877852522924731, 0}, {
       0.838670567945424, -0.5446390350150271, 0}}]], 
    Line3DBox[
     NCache[{{Cos[33 Degree], -Sin[33 Degree], 0}, {
       Rational[1, 2] 3^Rational[1, 2], Rational[-1, 2], 0}}, {{
       0.838670567945424, -0.5446390350150271, 0}, {
       0.8660254037844386, -0.5, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 2] 3^Rational[1, 2], Rational[-1, 2], 0}, {
       Cos[27 Degree], -Sin[27 Degree], 0}}, {{0.8660254037844386, -0.5, 0}, {
       0.8910065241883679, -0.45399049973954675`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[27 Degree], -Sin[27 Degree], 0}, {
       Cos[24 Degree], -Sin[24 Degree], 0}}, {{
       0.8910065241883679, -0.45399049973954675`, 0}, {
       0.9135454576426009, -0.4067366430758002, 0}}]], 
    Line3DBox[
     NCache[{{Cos[24 Degree], -Sin[24 Degree], 0}, {
       Cos[21 Degree], -Sin[21 Degree], 0}}, {{
       0.9135454576426009, -0.4067366430758002, 0}, {
       0.9335804264972017, -0.35836794954530027`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[21 Degree], -Sin[21 Degree], 
        0}, {(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (1 - 5^Rational[1, 2]), 0}}, {{
       0.9335804264972017, -0.35836794954530027`, 0}, {
       0.9510565162951535, -0.30901699437494745`, 0}}]], 
    Line3DBox[
     NCache[{{(Rational[5, 8] + Rational[1, 8] 5^Rational[1, 2])^
        Rational[1, 2], Rational[1, 4] (1 - 5^Rational[1, 2]), 0}, {
       Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        Rational[-1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 0}}, {{
       0.9510565162951535, -0.30901699437494745`, 0}, {
       0.9659258262890682, -0.2588190451025207, 0}}]], 
    Line3DBox[
     NCache[{{Rational[1, 2] 2^Rational[-1, 2] (1 + 3^Rational[1, 2]), 
        Rational[-1, 2] 2^Rational[-1, 2] (-1 + 3^Rational[1, 2]), 0}, {
       Cos[12 Degree], -Sin[12 Degree], 0}}, {{
       0.9659258262890682, -0.2588190451025207, 0}, {
       0.9781476007338057, -0.20791169081775934`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[12 Degree], -Sin[12 Degree], 0}, {
       Cos[9 Degree], -Sin[9 Degree], 0}}, {{
       0.9781476007338057, -0.20791169081775934`, 0}, {
       0.9876883405951378, -0.15643446504023087`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[9 Degree], -Sin[9 Degree], 0}, {
       Cos[6 Degree], -Sin[6 Degree], 0}}, {{
       0.9876883405951378, -0.15643446504023087`, 0}, {
       0.9945218953682733, -0.10452846326765347`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[6 Degree], -Sin[6 Degree], 0}, {
       Cos[3 Degree], -Sin[3 Degree], 0}}, {{
       0.9945218953682733, -0.10452846326765347`, 0}, {
       0.9986295347545738, -0.052335956242943835`, 0}}]], 
    Line3DBox[
     NCache[{{Cos[3 Degree], -Sin[3 Degree], 0}, {1, 0, 0}}, {{
       0.9986295347545738, -0.052335956242943835`, 0}, {1, 0, 0}}]]}},
  ImageSize->{147., Automatic},
  ViewPoint->{30, 20, 10}]], "Output",
 CellChangeTimes->{{3.546999659562562*^9, 3.5469996775961933`*^9}, 
   3.5469997362522955`*^9, {3.594740391361497*^9, 3.5947403989035087`*^9}, {
   3.5947404375110617`*^9, 3.594740471803111*^9}, 3.594745841984692*^9, 
   3.595018220510356*^9, 3.600198291137869*^9, 3.600207201854794*^9}]
}, Open  ]],

Cell[TextData[{
 "FOR DOTTING POLYGONAL CURVES. MAKE ",
 StyleBox["SEE",
  FontSlant->"Italic"],
 " = ",
 StyleBox["FALSE&",
  FontSlant->"Italic"],
 " TO DOT THE WHOLE THING. NEED VISIBLE SEGMENTS FOR THIS. \nA SEGMENT IS  \
DELETED IF ONE ENDPOINT FAILS TO SATISFY THE KEEP CONDITION.  MAKE ",
 StyleBox["KEEP",
  FontSlant->"Italic"],
 " = ",
 StyleBox["TRUE",
  FontSlant->"Italic"],
 " ",
 StyleBox["&",
  FontSlant->"Italic"],
 " FOR NO CHANGE."
}], "SmallText",
 FontColor->RGBColor[1, 0, 0]],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"SubdivisionPoints", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"x1_", ",", "x2_"}], "}"}], ",", "tol_"}], "]"}], ":=", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"npts", "=", 
      RowBox[{"1", "+", 
       RowBox[{"3", 
        RowBox[{"Floor", "[", 
         RowBox[{
          RowBox[{"length", "[", 
           RowBox[{"x2", "-", "x1"}], "]"}], "/", "tol"}], "]"}]}]}]}], ";", 
     RowBox[{
      RowBox[{
       RowBox[{"x1", "+", 
        RowBox[{
         RowBox[{"#", "/", "npts"}], 
         RowBox[{"(", 
          RowBox[{"x2", "-", "x1"}], ")"}]}]}], "&"}], "/@", 
      RowBox[{"Range", "[", 
       RowBox[{"0", ",", "npts"}], "]"}]}]}], ")"}]}], ";", 
  RowBox[{
   RowBox[{"PartitionedSegmentList", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"x1_", ",", "x2_"}], "}"}], ",", "tol_"}], "]"}], ":=", 
   RowBox[{"SegmentList", "[", 
    RowBox[{"SubdivisionPoints", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"x1", ",", "x2"}], "}"}], ",", "tol"}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"DotLineListVisible", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"x1_", ",", "x2_"}], "}"}], ",", "tol_", ",", "see_"}], "]"}], ":=", 
   RowBox[{"VisibleSegments", "[", 
    RowBox[{
     RowBox[{"SegmentList", "[", 
      RowBox[{"SubdivisionPoints", "[", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"x1", ",", "x2"}], "}"}], ",", "tol"}], "]"}], "]"}], ",", 
     "see"}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"DotLineListThird", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"x1_", ",", "x2_"}], "}"}], ",", "tol_"}], "]"}], 
   "                  ", ":=", "     ", 
   RowBox[{"ThirdSegments", "[", 
    RowBox[{"SubdivisionPoints", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"x1", ",", "x2"}], "}"}], ",", "tol"}], "]"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"DotLineListVisible", "[", 
    RowBox[{"PointList_", ",", "tol_", ",", "see_"}], "]"}], ":=", 
   RowBox[{"Flatten", "[", 
    RowBox[{
     RowBox[{"Map", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"DotLineListVisible", "[", 
         RowBox[{"#", ",", "tol", ",", "see"}], "]"}], " ", "&"}], ",", 
       RowBox[{"SegmentList", "[", "PointList", "]"}]}], "]"}], ",", "1"}], 
    "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"DotLineListThird", "[", 
    RowBox[{"PointList_", ",", "tol_"}], "]"}], "                  ", ":=", 
   RowBox[{"Flatten", "[", 
    RowBox[{
     RowBox[{"Map", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"DotLineListThird", "[", 
         RowBox[{"#", ",", "tol"}], "]"}], " ", "&"}], ",", "               ", 
       RowBox[{"SegmentList", "[", "PointList", "]"}]}], "]"}], ",", "1"}], 
    "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"DotLine", "[", 
    RowBox[{
    "PointList_", ",", "tol_", ",", "see_", ",", "keep_", ",", 
     "ThicknessSolid_", ",", "ThicknessDot_"}], "]"}], ":=", 
   RowBox[{"{", " ", "\n", 
    RowBox[{
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"ThicknessDot", "==", "0"}], ",", 
       RowBox[{"{", "}"}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"Thickness", "[", "ThicknessDot", "]"}], ",", "     ", 
         RowBox[{"Line", "/@", 
          RowBox[{"Select", "[", 
           RowBox[{
            RowBox[{"DotLineListThird", "[", 
             RowBox[{"PointList", ",", "tol"}], "]"}], ",", 
            RowBox[{
             RowBox[{
              RowBox[{"keep", "[", 
               RowBox[{"#", "[", 
                RowBox[{"[", "1", "]"}], "]"}], "]"}], "&&", 
              RowBox[{"keep", "[", 
               RowBox[{"#", "[", 
                RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "&"}]}], "]"}]}]}], 
        "}"}]}], "]"}], ",", "\n", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"Thickness", "[", "ThicknessSolid", "]"}], ",", 
       RowBox[{"Line", "/@", 
        RowBox[{"DotLineListVisible", "[", 
         RowBox[{"PointList", ",", "tol", ",", "see"}], "]"}]}]}], "}"}]}], 
    "         ", "}"}]}], ";"}]}], "Input"],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"MinceSegment", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"v1_", ",", "v2_"}], "}"}], ",", "tol_"}], "]"}], ":=", 
   RowBox[{
    RowBox[{
     RowBox[{"(", 
      RowBox[{"v1", "+", 
       RowBox[{"#", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{"v2", "-", "v1"}], ")"}], "/", 
         RowBox[{"Ceiling", "[", 
          FractionBox[
           RowBox[{"length", "[", 
            RowBox[{"v2", "-", "v1"}], "]"}], "tol"], "]"}]}]}]}], ")"}], 
     "&"}], "/@", 
    RowBox[{"Range", "[", 
     RowBox[{"0", ",", 
      RowBox[{"Ceiling", "[", 
       FractionBox[
        RowBox[{"length", "[", 
         RowBox[{"v2", "-", "v1"}], "]"}], "tol"], "]"}]}], "]"}]}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"MinceCurve", "[", 
    RowBox[{"PointList_", ",", "tol_"}], "]"}], ":=", 
   RowBox[{"Flatten", "[", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"MinceSegment", "[", 
        RowBox[{"#", ",", "tol"}], "]"}], "&"}], "/@", 
      RowBox[{"SegmentList", "[", "PointList", "]"}]}], ",", "1"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"Redistribute", "[", 
    RowBox[{"PointList_", ",", "tol_", ",", "dashlength_"}], "]"}], ":=", 
   RowBox[{"Part", "[", 
    RowBox[{
     RowBox[{"MinceCurve", "[", 
      RowBox[{"PointList", ",", "tol"}], "]"}], ",", 
     RowBox[{"Range", "[", 
      RowBox[{"1", ",", 
       RowBox[{"Length", "[", 
        RowBox[{"MinceCurve", "[", 
         RowBox[{"PointList", ",", "tol"}], "]"}], "]"}], ",", 
       RowBox[{"Round", "[", 
        FractionBox["dashlength", "tol"], "]"}]}], "]"}]}], "]"}]}], 
  ";"}]}], "Input"],

Cell["\<\
A LIST OF SEGMENTS. LENGTH OF POINTLIST MAKES A DIFFERENCE FOR ENDS OF CURVE. \
USED FOR CIRCULAR HALOS IN MONTE CARLO.\
\>", "SmallText",
 Evaluatable->False,
 AspectRatioFixed->True],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"DotCurveList", "[", "PointList_", "]"}], ":=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"PointList", "[", 
        RowBox[{"[", "i", "]"}], "]"}], ",", 
       RowBox[{"PointList", "[", 
        RowBox[{"[", 
         RowBox[{"i", "+", "1"}], "]"}], "]"}]}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", "1", ",", 
       RowBox[{
        RowBox[{"Length", "[", "PointList", "]"}], "-", "1"}], ",", "3"}], 
      "}"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"DotCurveList", "[", 
    RowBox[{"PointList_", ",", "tol_", ",", "dashlength_"}], "]"}], ":=", 
   RowBox[{"DotCurveList", "[", 
    RowBox[{"Redistribute", "[", 
     RowBox[{"PointList", ",", "tol", ",", "dashlength"}], "]"}], "]"}]}], 
  ";"}]}], "Input"]
},
WindowToolbars->"RulerBar",
CellGrouping->Manual,
WindowSize->{1017, 878},
WindowMargins->{{91, Automatic}, {10, Automatic}},
PrintingCopies->1,
PrintingPageRange->{Automatic, Automatic},
PageHeaders->{{
   Cell[
    TextData[{
      ValueBox["FileName"]}], "Header"], Inherited, 
   Cell[
    TextData[{
      CounterBox["Page"]}], "PageNumber"]}, {
   Cell[
    TextData[{
      ValueBox["FileName"]}], "Header"], Inherited, 
   Cell[
    TextData[{
      CounterBox["Page"]}], "PageNumber"]}},
PageHeaderLines->{False, Inherited},
PrintingOptions->{"PrintCellBrackets"->False,
"PrintMultipleHorizontalPages"->False,
"PrintRegistrationMarks"->False,
"PrintingMargins"->{{21.5625, 21.5625}, {7.1875, 36}}},
PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1},
"VersionedStylesheet"->{"Default.nb"[8.] -> False}},
ShowCellLabel->True,
ShowCellTags->False,
RenderingOptions->{"ObjectDithering"->True,
"RasterDithering"->False},
FrontEndVersion->"9.0 for Linux x86 (64-bit) (February 7, 2013)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[545, 20, 183, 2, 31, "Text"],
Cell[CellGroupData[{
Cell[753, 26, 1448, 40, 99, "Input"],
Cell[2204, 68, 616, 12, 31, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[2857, 85, 50049, 1537, 4022, "Input",
 PageBreakWithin->Automatic,
 PageBreakBelow->Automatic],
Cell[CellGroupData[{
Cell[52931, 1626, 2830, 82, 143, "Input"],
Cell[55764, 1710, 792, 22, 54, "Output"],
Cell[56559, 1734, 647, 18, 54, "Output"]
}, Open  ]],
Cell[57221, 1755, 145, 3, 28, "SmallText",
 Evaluatable->False],
Cell[57369, 1760, 1588, 52, 99, "Input",
 PageBreakBelow->Automatic],
Cell[58960, 1814, 232, 8, 28, "SmallText",
 Evaluatable->False],
Cell[59195, 1824, 11967, 319, 847, "Input"],
Cell[71165, 2145, 362, 14, 47, "SmallText",
 Evaluatable->False],
Cell[71530, 2161, 5526, 149, 395, "Input"]
}, Open  ]],
Cell[77071, 2313, 128, 2, 28, "SmallText"],
Cell[CellGroupData[{
Cell[77224, 2319, 818, 22, 55, "Input"],
Cell[78045, 2343, 25769, 513, 156, "Output"]
}, Open  ]],
Cell[103829, 2859, 499, 19, 47, "SmallText"],
Cell[104331, 2880, 4133, 124, 319, "Input"],
Cell[108467, 3006, 1682, 54, 196, "Input"],
Cell[110152, 3062, 194, 5, 47, "SmallText",
 Evaluatable->False],
Cell[110349, 3069, 843, 25, 55, "Input"]
}
]
*)

(* End of internal cache information *)
